form visible if parent has record

D

deb

I have a form called fTLNo with autonumber id called TLNoID
and a subform called f001WithinS with autonumber id called WSID.

I only want the subform to be visible if the parent form TLNoID has a
record. (not showing autonumber as the ID).

Please help, thanks!!
 
K

Ken Sheridan

Deb:

In the parent form's Current event procedure put:

Me.f001WithinS.Visible = Not Me.NewRecord

This assumes that f001WithinS is the name of the subform control, i.e. the
control in the parent form's Controls collection which houses the subform,
not the name of the underlying form object (unless both have the same name of
course).

To make the subform visible once you start to add a new record in the parent
form put the following in the parent form's BeforeInsert event procedure:

Me.f001WithinS.Visible = True

Ken Sheridan
Stafford, England
 

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

Similar Threads

dlookup in sub subform 2
complicated if on form 3
If is null 1
make a record dirty 11
primary key - concatenated or autonumber? 6
If help 2
I cann't fill in a subform 1
validation help 8

Top