visible property

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

Guest

I have a subform that opens invisible to start a "encounter clock" to time a
session. When a button is clicked on the main form to end the session, I
want that subform to appear so that the user can "sign off and stop the
clock" on the session then click a button located on that subform to save the
"clock and sign off" info then make the subform become invisible again so
that the user to go on to another record. After the code to save the record,
I wrote : Forms!StartEncounter.Visible = False but got the error "Microsoft
Access can't find the form StartEncounter referred to in Visual Basic. What
did I do wrong?
 
You have to reference the subform through the main form. Something like:

Forms!MainForm!StartEncounter.Visible = false

If the code is on the form itself, you can use:

Me.StartEncounter.Visible = False

This assumes that the name of the subform CONTROL on the main form is named
"StartEncounter". The subform control can have a different nave from the
subform itself.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Hi -

It's not the form itself you want to make invisible - it's the subform
control on the main form. When you click the button on the subform to
close it, go back to a control on the main form, then use
me![subformcontainer].visible=false to hide it again.

As for the error - is StartEncounter the name of the form, or is it the
name of the subform control on the main form? If it is the control
name, that is the cause of the error.

John
 

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