Help with SourceObject & Subform

S

Silvio

Back ground: I have a form with a subform in it. The main form works like a
side-menu bar to lunch different form in the subform. That is accomplished by
programmatically changing the subform “SourceObject†to the required forms.
Now I would like to take it one step further, I have some of these subforms
that have a “see detail†button in it. What that does, is to open a form for
the selected record and shows all that record details in a pup-up form. What
I would like to accomplish is to actually lunch that details form in my
subform by changing the SourceObject substitute the SUBFORM from products
list to product details and then have a button on the product details that
will bring you back to the product list (Web-like navigation process). Can it
be done?

The pieces of codes I have so far are:
To change the SourceObject from the main form
Me.[SubItems].[SourceObject] = "frmCalibTiming"


To open the view details in a separate form:
Dim strWhere As String
strWhere = "[ProductID]=" & Me![Product_ID]
DoCmd.OpenForm "frmEditCalibration", , , strWhere

I guess what I am trying to do is a combination of this codes. Any
step-by-step guide is appreciated.

Thank you,
Silvio
 
J

Jeanette Cunningham

Hi Silvio,
an interesting idea.
If you save the ProductID from the product form somewhere on the main form,
I imagine that it would be easy to change the subform's source object to the
detail form and either use a filter for ProductID or build the entire
recordsource for the subform using a Where clause for the ProductID.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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