Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Thanked 0 Times in 0 Posts

    Passing calendar values (2002)

    I have three date fields and want to have buttons next to their text boxes that open a calendar form to allow the date to be selected. I'm trying to use OpenArgs for the calendar form to set the start date to display in the calendar. The OpenArgs are set to, for example, txtStartDate (the text box on the main form) and I then try to set the calendar's value to this date using the Open Event of the calendar form.

    However, the date shown of the calendar doesn't change, even if I try CDate(txtStartDate). What might the problem be? How would you suggest I return a new date value to the main form? Thanks, Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Passing calendar values (2002)

    Use the On Load event instead of the On Open event. On Open occurs too early.

    You can set the value of a text box on the main form to the value of the calendar control:

    Private Sub Calendar0_AfterUpdate()
    Forms!frmMain!txtStartDate = Me!Calendar0
    End Sub

    where frmMain is the name of the main form and Calendar0 is the name of the calendar control.

Posting Permissions

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