Changing the subform

  • Thread starter Thread starter James Heaver
  • Start date Start date
J

James Heaver

Hi,
This may be a simple question, or it may not. I don't
have the experiance to know, but it feels liek it should be
straight foward.
I have created a form with a series of buttons at the top
and a subform filling up the rest of the screen.
The intention is that this form willstay on the screen
the whole time as a sort of 'toolbar' and by clicking the
buttons at the top you wil change the form displayed as the
sub form so you can perform different tasks.
I have created all the forms I want but what I need help
doing is getting the buttons to display them as the sub-form.

Thanks for any help
James
 
Try this: -

1. Name the SubForm to "FormViewer" for this example.
2. For each button, set the "Me.FormViewer.SourceObject"
to the Form you are launching.
3. Refresh the "FormViewer".

E.g. For Command "OpenForm1": -
Me.FormViewer.SourceObject = "Form1"
Me.FormViewer.Requery

NB

ENSURE THAT ON THE "FormViewer" PROPERTIES, THE "Link
Master Fields" AND "Link Child Fields" ARE BOTH EMPTY!!

Hope This Helps


Tony C
 
Hi
I've done that and it works fine. The problem i'm ahvign
now is that some of the forms don't work when displayed as
a sub form.

For example for one form (user search) there is a text box
(txtUserSearch) which forms part of the criteria for the
query (Like [Forms]![users search]![txtUserSearch] & "*")

This works fine when I open the form seperatly, but as a
subform it comes up with a popup box asking for
"Forms!users search!txtUserSearch".

I'm guessing that when viewed as a subform the textr box
has a different name but I can't work out what. The form
will only be viewed as a subform so any solution can break
it when its viewed seperatly.

Thanks
James
 
Hello Again

The way around the query problem is to re-define the
criteria, as the form is opened on a Sub Form, you need to
make these declarations in the Query Criteria Syntax: -

(Like [Forms]![MASTERFORM]![FORMVIEWER].Form!
[txtUserSearch] & "*")

HTH

Tony C.
-----Original Message-----
Hi
I've done that and it works fine. The problem i'm ahvign
now is that some of the forms don't work when displayed as
a sub form.

For example for one form (user search) there is a text box
(txtUserSearch) which forms part of the criteria for the
query (Like [Forms]![users search]![txtUserSearch] & "*")

This works fine when I open the form seperatly, but as a
subform it comes up with a popup box asking for
"Forms!users search!txtUserSearch".

I'm guessing that when viewed as a subform the textr box
has a different name but I can't work out what. The form
will only be viewed as a subform so any solution can break
it when its viewed seperatly.

Thanks
James
-----Original Message-----
Try this: -

1. Name the SubForm to "FormViewer" for this example.
2. For each button, set the "Me.FormViewer.SourceObject"
to the Form you are launching.
3. Refresh the "FormViewer".

E.g. For Command "OpenForm1": -
Me.FormViewer.SourceObject = "Form1"
Me.FormViewer.Requery

NB

ENSURE THAT ON THE "FormViewer" PROPERTIES, THE "Link
Master Fields" AND "Link Child Fields" ARE BOTH EMPTY!!

Hope This Helps


Tony C should
be
.
.
 
Back
Top