Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query as part of a sub form

Status
Not open for further replies.

soulfunkuk

IS-IT--Management
Sep 1, 2005
13
GB
Hi,

I have two subforms as part of a main form.

The first subform is a data entry form based on a table.

The second subform is a query based on the table.

Is it possible to see new records entered in the first subform, on the query subform without leaving the main form??
 
How are ya soulfunkuk . . . . .

Requery the [blue]second subform[/blue] from the [blue]AfterUpdate[/blue] event of the [blue]first subform[/blue].

Calvin.gif
See Ya! . . . . . .
 
I have a subform "frmEventsSub" as part of a mainform "frmeLogbook". From the main form I want to run a code to change the Recordsource of the Subform lets say from "query1" to "query2". I tried all different kinds of combinations to adress the RecordSouce of that Subform but I always get an eror back. It either thinks the subform is a field on the mainform or it does not recognise the command at all and gives an application defined error.

Tried code like:
Me!SubForm.Form.RecordSource = "query1"
Me![frmEventsSub].Form.RecordSource ="query2"
Forms!frmeLogbook.frmEventsSub.Form!RecordSource = "query2"
Forms!frmeLogbook.frmEventsSub.Form.RecordSource = "query2"
Forms!frmeLogbook.frmEventsSub.RecordSource = "query2"

Can someone give the the correct syntax to adress and change that Recordsource on the subfform and requery the subform afterwards.

I am using Access97

Thank you.
 
Have a look here:

To discover the subform control name you may play with the expression builder (loaded forms).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
and this:
Code:
[blue]   [frmEventsSub].Form.RecordSource ="query2"[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top