Form name as string

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
 
R

Rick Brandt

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top