Closing a subform

  • Thread starter Thread starter rruston
  • Start date Start date
R

rruston

I am trying to make a subform close after one entry. The table behind the
subform has a one to one relationship with the table behind the main form.
I've tried everything I can think of, and can't find anything that works.
Help!
 
I am trying to make a subform close after one entry.  The table behind the
subform has a one to one relationship with the table behind the main form..  
I've tried everything I can think of, and can't find anything that works. 
Help!

1) Right-click on the control and choose "properties"
2) Under the "Event" tab, for the "After Update" property, click the
"..." and choose "Code Builder"
3) Inside the Sub type:
DoCmd.Close
 
Set the Subform Controls Visible property to False;

Me![SubformControlName].Visible = False

You'll need to set it back to True again via some event;

Me![SubformControlname].Visible = True

Can't tell you which events to use since I don't know anything
about the circumstances.
 
OK. I can make a field disappear, but not the form. When I put the name of
the form in, it wants a field name. I know it's something I'm doing wrong....

Beetle said:
Set the Subform Controls Visible property to False;

Me![SubformControlName].Visible = False

You'll need to set it back to True again via some event;

Me![SubformControlname].Visible = True

Can't tell you which events to use since I don't know anything
about the circumstances.
--
_________

Sean Bailey


rruston said:
I am trying to make a subform close after one entry. The table behind the
subform has a one to one relationship with the table behind the main form.
I've tried everything I can think of, and can't find anything that works.
Help!
 
The subform control is a control on the main form, and it's the control that
"houses" the subform itself. Open your main form in design view, click on
top edge of the control that is the subform, open the Properties window,
click on Other tab, and see the Name property. That is the name that you use
in the example "Visible = False" step.

--

Ken Snell
http://www.accessmvp.com/KDSnell/


rruston said:
OK. I can make a field disappear, but not the form. When I put the name
of
the form in, it wants a field name. I know it's something I'm doing
wrong....

Beetle said:
Set the Subform Controls Visible property to False;

Me![SubformControlName].Visible = False

You'll need to set it back to True again via some event;

Me![SubformControlname].Visible = True

Can't tell you which events to use since I don't know anything
about the circumstances.
--
_________

Sean Bailey


rruston said:
I am trying to make a subform close after one entry. The table behind
the
subform has a one to one relationship with the table behind the main
form.
I've tried everything I can think of, and can't find anything that
works.
Help!
 
I'm getting this error: Run-time error '424': Object required

With this code:

Private Sub List6_AfterUpdate ()
Invention.Forms![Invention Entry Form]![Open Lead Inventor Form].Visible =
False
End Sub

rruston
 
I'm getting this error: Run-time error '424': Object required

With this code:

Private Sub List6_AfterUpdate ()
Invention.Forms![Invention Entry Form]![Open Lead Inventor Form].Visible =
False
End Sub


I think you need to remove the Invention. at the start of this string. What
does it refer to???

The syntax is

Forms![MainForm]![Subform].Visible = False

where MainForm is the name of the main form, and Subform is the name of the
*subform control* on the main form; this might be different from the name of
the form object within that subform control.
 
Back
Top