I wrote the following code to open up a form using a variable name.
Dim stDocName, Asset_Num as String
StDocName="frm List"
DoCmd.OpenForm stDocName
The form, "frm List" opens with out a problem. However, when I try to populate a field, as in :
Forms!stDocName.[Assets] = Asset_Num
I get the error message, "Cannot find the form "stDocName"."
I need to be able to select different forms and use the variable name to open and set data. How do I get Access to recognize that stDocName is a variable?
Thanks, Bill Heath
Dim stDocName, Asset_Num as String
StDocName="frm List"
DoCmd.OpenForm stDocName
The form, "frm List" opens with out a problem. However, when I try to populate a field, as in :
Forms!stDocName.[Assets] = Asset_Num
I get the error message, "Cannot find the form "stDocName"."
I need to be able to select different forms and use the variable name to open and set data. How do I get Access to recognize that stDocName is a variable?
Thanks, Bill Heath