Identify calling form for use by a common calander form

  • Thread starter Thread starter Phil Everist
  • Start date Start date
P

Phil Everist

I have a calander form that operates as a popup. Clicking a
date populates that date into the date field on the form
with the calendar control.
I want to be able to use the same calendar popup from
multiple forms. How can I identify which form triggered the
calendar control so I can update the appropriatre date
field?
 
Pass the name of the calling form in the OpenArgs parameter of the
DoCmd.OpenForm call.
 
Add this code to your code that populates that date into the date field on the
form with the calendar control:
Me.Visible = False

Replace the code you now have to open the calendar form with this code:

DoCmd.OpenForm "NameOfCalendarForm",,,,,acDialog
Me!NameOfDateFieldOnCallingForm = Forms!NameOfCalendarForm!
NameOfDateTextBoxOnCalendarForm
Docmd.Close acForm, "NameOfCalendarForm"

Note: Watch word wrap in lines 2 and 3
 
Back
Top