G
Guest
I have created a Function that works on the Click Event of a button on a
form. The function takes the Caption of the button_label and does a DLookup
to retrieve associated data.
Within the Function I end up with two string values (strAirportID and
strCityState). I need to return these two values to their respective unbound
textboxes (frmID and frmCityState) on the form from where the button was
clicked.
Normally I could use the Me.frmID = strAirportID (for example) to do this if
I were using a Private Sub, but, of course, I can't use the Me. in this case.
So, how can I do this, and forgive me. I'm still learning VB.
(By the way, the form is being designed to work in two ways. First, the
user can select from a combo box the AirportID. The database will then
lookup the CityState and put the values in an Intinerary textbox. Or,
secondly, (the reason for the Function) I have placed several command buttons
on the form for "common" Airport IDs, where the user can click and have the
appropriate fields populate automatically without a search.)
form. The function takes the Caption of the button_label and does a DLookup
to retrieve associated data.
Within the Function I end up with two string values (strAirportID and
strCityState). I need to return these two values to their respective unbound
textboxes (frmID and frmCityState) on the form from where the button was
clicked.
Normally I could use the Me.frmID = strAirportID (for example) to do this if
I were using a Private Sub, but, of course, I can't use the Me. in this case.
So, how can I do this, and forgive me. I'm still learning VB.
(By the way, the form is being designed to work in two ways. First, the
user can select from a combo box the AirportID. The database will then
lookup the CityState and put the values in an Intinerary textbox. Or,
secondly, (the reason for the Function) I have placed several command buttons
on the form for "common" Airport IDs, where the user can click and have the
appropriate fields populate automatically without a search.)