about the hiding of forms

G

Guest

Bruce I read your response on the hiding and thereafter displaying of
subforms on the main and I quote "from what I understand you may be able
to get what you need by setting the subform control's visible property to No.
To do this, click on the subform in design view for the main form, then
click View > Properties. Another approach would be to use the form's Current
event to set the subform control's visible property to False. To make it
visible you can use a tab control's Click event, or a command button, or
whatever suits your needs."

Could you please in a little more detail explain how exactly one would go
about this giving the coding if necessary and or the exact steps to take.
Thanks in advance.
 
G

Guest

In form design view, click Properties. Click the Events tab. Double-click in
the On Current box until it says [Event Procedure]. Click the ellipsis to the
right (...). This will create a spot to put the code that runs whenever the
form goes to a different record. Add the middle lines below to complete the
event:

Private Sub Form_Current()
yourSubformName.Visible = False
End Sub

Substitute the name of your subform for yourSubformName above. This makes
the subform invisible each time you go to a different record on the form.

Now make a button on your form header. Right-click the button, click
Properties, click the Format tab, and make its caption something like Show
Subform. Now click the Events tab, and double-click the On Click box until it
says[ Event Procedure]. Click the ellipsis to the right (...). Assuming your
button is called Button1, this is the code.

Private Sub Button1Click()
yourSubformName.Visible = True
End Sub
 

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