+ Reply to Thread
Results 1 to 8 of 8

Forms and controls

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Forms and controls

    Hi,
    I am very new to the forms concept.
    I have been working with calendar and worksheet.
    I have been using this Now() function to update the current date in the calender
    But if I want to restrict selecting previous date, then how should I do that?
    Now I placed a button in the form which will override the restriction on the calender when a password is matched.
    I also want to display the current date and time in the text box as I load the form.But I can't do that, when even i click on anything the form gets updated but not by default.How do I show current date and time on form load time?

    Last, If I select to enable the calendar with the password, is it possible to copy the date and time in the sheet1 instantly?And if I reopen the form and enable password to enter previous date, it will again append the date and time below the previous entry?
    Please guide me.
    Thanks in advance.
    Me.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Forms and controls

    Hi,

    This bit of code may help.
    Private Sub Calendar1_Click()
    If Calendar1.Value < Now() Then
        MsgBox "Select a Date greater than today"
    End If
    End Sub
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Forms and controls

    Hi charles,
    That worked,but I can't select today, as the code will let me select from the next day.
    Also Please guide me how to do the override and write on the sheet is I select to override.
    Thanks in advance.
    Me

  4. #4
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Forms and controls

    Hi,

    Here's your file modified for your request.
    Check it and let us know if this is what you want.
    I did not hide the password as it is being typed.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Forms and controls

    Hi Charles,
    Really appreciate for helping me around.
    But This is what I am trying to do...I am explaining this a flow chart type.So that I can express better.

    First I open the form.

    Second I select the date. I can select any date from today onward and the same is displayed in the test box, but if date selected before today,then a error message is always shows.

    Third if I click enable previous date, then it asks for the password,if the password is right, then i can select any date from the calendar without any error message and the date is displayed on the text box. At the same time the date and time is also recorded in the sheet1.

    but if the password is wrong, the message box will show, wrong password, without recording anything in the sheet1.

    Please guide me,
    Thanks in advance.
    Me.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Forms and controls

    Hi,

    I made some modification to the code. Hopefully this is what you want.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Forms and controls

    Hi Charles.
    Thanks for the updates, everything is perfect.
    Thanks for teaching forms! :D
    Thanks in advance.
    me
    Last edited by fatalcore; 05-02-2012 at 01:05 AM. Reason: Solved

  8. #8
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Forms and controls

    Hi,

    If your happy with the answer be sure you click the Star below the members name.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1