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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing RecordSource on Form Based on New Query

Status
Not open for further replies.

nobuddy

MIS
Sep 30, 2000
10
US
I have a form (frmSelectSeg), where the user is going to create their own query. The first control is a text box (Name) where they enter the name of the query that they want to create. The second control is a multi-select list box (lbSegment) where they choose the segments for their query. Then they click on a command button that generates the query. I have all of this working fabulously. The problem is, I need to be able to have them open another form once the query is created that will have its RecordSource set to the query. So they will click on the first button to run the query. If it looks okay, they will click on another button that will take them to another form that is based on the query they just generated. How do I do that?
 
All a bit too vafue to give exact solution to you but you may want to look at the help for the openargs property of the openform command. This effectively allows you to pass a parameter to the new form. This parameter could be the SQL string of your query.

In the new form's On Ope event you could then have Me.Recordsource=Me.Openargs.

Hope this hepls.



Bill Paton
william.paton@ubsw.com
Check out my website !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top