Form name as string

  • Thread starter Thread starter UpRider
  • Start date Start date
U

UpRider

This should be easy but I can't get past the errors....
Below is a simplified version of what I am trying to do.
The code is in a module.

dim frmName as string
frmName = "Report1"
Forms!frmName.visible = false

Access tells me it can't find a form named "frmName"
How can I use a variable here?

UpRider
 
UpRider said:
This should be easy but I can't get past the errors....
Below is a simplified version of what I am trying to do.
The code is in a module.

dim frmName as string
frmName = "Report1"
Forms!frmName.visible = false

Forms(frmName).Visible = False
 
Back
Top