Why doesnt this work:
dim ctl as Control
strfromdate=forms("OTDSwitchBoard")("FromDate")
set ctl=strfromdate
But this does:
dim ctl as Control
set ctl=forms("OTDSwitchBoard")("FromDate")
I need the value of ctl to be a variable that I read from the OpenArgs string of the form. How do I make this work??
More details:
Form1 has a field for StartDate and StopDate. I want to fill these in with the beginning and ending dates of our "manufacturing month" (which doesn't correspond exactly to the calendar month)
When user clicks the MfgMonth button on Form1, Form2 opens. The OpenArgs for Form2 contains names of the StartDate and StopDate controsl on Form1. User will click on the appropriate "month" button on Form2. Form2 calculates the beginning and ending dates for the month, and writes them back to the appropriate controls on Form1.
I want to use this for a bunch of different forms, and the names of the controls for StartDate and StopDate will not always be the same. So, I want this to be a variable.
Access 2002.
dim ctl as Control
strfromdate=forms("OTDSwitchBoard")("FromDate")
set ctl=strfromdate
But this does:
dim ctl as Control
set ctl=forms("OTDSwitchBoard")("FromDate")
I need the value of ctl to be a variable that I read from the OpenArgs string of the form. How do I make this work??
More details:
Form1 has a field for StartDate and StopDate. I want to fill these in with the beginning and ending dates of our "manufacturing month" (which doesn't correspond exactly to the calendar month)
When user clicks the MfgMonth button on Form1, Form2 opens. The OpenArgs for Form2 contains names of the StartDate and StopDate controsl on Form1. User will click on the appropriate "month" button on Form2. Form2 calculates the beginning and ending dates for the month, and writes them back to the appropriate controls on Form1.
I want to use this for a bunch of different forms, and the names of the controls for StartDate and StopDate will not always be the same. So, I want this to be a variable.
Access 2002.