How do I pass a control location around in a variable?
Specifically, I have a form with the calendar control. I want to be able to double click on a control on another form and have that form tell the calendar where to stick its value once the user is happy with it.
I made a public variable to hold the target:
Public strDateDestination as String
So the idea is to copy the control in the form of a string to this variable when I double click it, then open the Calendar form
strDateDestination = "frmUser!Date"
doCmd.OpenForm "frmCalendar", acNormal
THEN, after choosing the date, you hit the OK button and the calendar form writes the value of the calendar control to whatever location you stuck in the variable. I don't know how to do that. I thought it would be
Forms(strDateDestination) = Me!Calendar.Value
but that didn't work.
-Joshua
Specifically, I have a form with the calendar control. I want to be able to double click on a control on another form and have that form tell the calendar where to stick its value once the user is happy with it.
I made a public variable to hold the target:
Public strDateDestination as String
So the idea is to copy the control in the form of a string to this variable when I double click it, then open the Calendar form
strDateDestination = "frmUser!Date"
doCmd.OpenForm "frmCalendar", acNormal
THEN, after choosing the date, you hit the OK button and the calendar form writes the value of the calendar control to whatever location you stuck in the variable. I don't know how to do that. I thought it would be
Forms(strDateDestination) = Me!Calendar.Value
but that didn't work.
-Joshua