How do I Hide and Show an Access Form?

  • Thread starter Thread starter ABinBoston
  • Start date Start date
A

ABinBoston

I have an access form that opens - if there is certain criteria, I want the
form to be hidden, and another form open to allow data to be entered, which
will be updated on the hidden form.

When a user clicks the OK button, I want the 2nd form to close, and the hidden
form to re-open, containing the values from the form that just closed.


Any help is appreciated - AB
 
AB,

To hide the form change the 'visible' property.

(If the form will have the focus at the execution of the following line...
use this:)
me.Visible = false

(If the form might not have focus you can declare it implicitly from
somewhere else)
Forms!frmNameOfHiddenForm.Visible = false

To make it reappear tie the same code to another event and change value to
"True"

to refer to the values stored on the hidden from from other forms you'd
place the following code in the Default value property of the object
(probably text box?)

forms!frmNameOfHiddenForm.txtTextBoxName

(frmNameOfHiddenForm is the name of the "Hidden" Form)
(txtTextBoxName is the name of the text box on the HIDDEN form)

The code goes in the default value property of a text box on ANOTHER form.

As far as having the form go visible/hidden in response to criteria; You
can nest the above code in an "If/Then" or "Case" Structure.

I'm new at this too, so I hope the info is what you were looking for. (I
learned how to do the If/Then and case stuff a month ago, and someone on
the newsgroups explained the "invisible form variable holder" thing to me
the other day. It does work well though)

Mike D.
 
Back
Top