subform requery

M

mcourter

i have form with a subform that isn't related to the main form.
the main form allows the user to select a table from a list, slect
fields from the selected table, then what should happen is after the
user clicks a view button the subform should display the chosen field
on a continous form that makes up the subform. the form uses a query
that is built by VBA code as it's record source once the view button is
clicked. the query is getting updated, but the subform is not.
i tried:

Me.frmMySubForm.Requery but no go.

what should i do?

tia,

mcnews
 
W

Wayne Morgan

A form opened as a subform is not "open" in its own right. It is open as a
part of the parent form. It is contained in a control on the parent form
called a subform control. You need to refer to this control when referring
to the subform. This control may or may not have the same name as the
subform itself. This control is where you would set the Child/Master link
properties, if you were using them.

Try:
Me.NameOfSubformControl.Form.Requery
 
M

mcnews

this got it for me:

Me!frmHandChoose.SetFocus
Me!frmHandChoose.Form.RecordSource = "zqryGetLab"
Me!frmHandChoose.Form.Requery
 

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