Sub forms

  • Thread starter Thread starter Beki
  • Start date Start date
Do you mean a hidden subform OR a new form that is liked
to the current data when you click on the command button?

If the latter, use the wizard when creating the command
button. When you add the command button, you can select
the form to open. Then it will ask you if you want to
open with all recoreds or based on selected records. This
will automaticly set the filter on.

HTH

Lee T.



-----Original Message-----
okay, thats put me in the right direction, but how do i
link the sub form to a button?

I am wanting the data to be linked, so the relevent data
to the main form will appear in the sub form.
-----Original Message-----
It wouldn't exactly be a subform, but a different form
that you open, perhaps with a link criteria.
Try something like this:
'Code Start
Private Sub MyBtn_Click()
DoCmd.OpenForm "MySubFormName",,,"MyLinkCriteria"
End Sub
'code end
your link cirteria should be something along the lines
of "[OrderDetailsTbl.OrderID] = " & Me![OrderID]

If you want to keep a subform hidden and only show it on
the button click, you can use the .Visible property of the
subform control.
HTH,
Ayelet
-----Original Message-----
I would like to know if it is possible to open a subform
from a button, and if so how?


.
.
.
 
I've tyed that before, and it didn't carry the data.

What i am doing, is creating a data base to hold variouse
information on diffrent people, and rather than searching
for them in different screens, i wanted the data for each
person to come up with the main form...if that makes any
sense!

Unless i'm doing something wrong, using the wizard to make
an open form button did not have this effect.

Beki
-----Original Message-----
Do you mean a hidden subform OR a new form that is liked
to the current data when you click on the command button?

If the latter, use the wizard when creating the command
button. When you add the command button, you can select
the form to open. Then it will ask you if you want to
open with all recoreds or based on selected records. This
will automaticly set the filter on.

HTH

Lee T.



-----Original Message-----
okay, thats put me in the right direction, but how do i
link the sub form to a button?

I am wanting the data to be linked, so the relevent data
to the main form will appear in the sub form.
-----Original Message-----
It wouldn't exactly be a subform, but a different form
that you open, perhaps with a link criteria.
Try something like this:
'Code Start
Private Sub MyBtn_Click()
DoCmd.OpenForm "MySubFormName",,,"MyLinkCriteria"
End Sub
'code end
your link cirteria should be something along the lines
of "[OrderDetailsTbl.OrderID] = " & Me![OrderID]

If you want to keep a subform hidden and only show it on
the button click, you can use the .Visible property of the
subform control.
HTH,
Ayelet
-----Original Message-----
I would like to know if it is possible to open a subform
from a button, and if so how?


.

.
.
.
 
Back
Top