Syntax Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To facilitate navigating the database, I hide and unhide certain main forms
and I needed a way to "remember" which form I came from so I can unhide it
when I am done with my little side trip. To remember how I got there, I have
set up public variables (strings) called TargetForm and ReturnForm so that
when I close a form it returns or makes visible the one I came from. However,
I am having trouble with the syntax when calling a variable within a form
command as shown below. Remember, I can't use Me.Visible, because I am
closing the current form, which is where this code is, and returning to the
original one, and this command is needed to make the original one visible
again.

Forms![ReturnForm].Visible = True

Access tells me it can't find the form ReturnForm, yet in the if statement
surrounding this, the mouse over value is there. Thanks for your help.
 
Rob, Thank you very much; it worked and now I am coding all my forms so I can
handle the navigation intelligently. Don't know how I would have found this
solution without these discussion groups. Thanks again.

Rob Oldfield said:
Very close.

forms(returnform).visible=false


apollo8359 said:
To facilitate navigating the database, I hide and unhide certain main forms
and I needed a way to "remember" which form I came from so I can unhide it
when I am done with my little side trip. To remember how I got there, I have
set up public variables (strings) called TargetForm and ReturnForm so that
when I close a form it returns or makes visible the one I came from. However,
I am having trouble with the syntax when calling a variable within a form
command as shown below. Remember, I can't use Me.Visible, because I am
closing the current form, which is where this code is, and returning to the
original one, and this command is needed to make the original one visible
again.

Forms![ReturnForm].Visible = True

Access tells me it can't find the form ReturnForm, yet in the if statement
surrounding this, the mouse over value is there. Thanks for your help.
 

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

Back
Top