Help with SQL

edp1959

Registered User.
Local time
Today, 06:22
Joined
Aug 24, 2003
Messages
23
Is this possible? I have a SQL statement stored in a module that I would like to call as a record source for several forms. I tried this but it didn't work.

In the OnOpen event of the form I put the following code:

Call PCSub_RS2 'Name of Public Function where SQL statement is
Me.AAAsubform.RecordSource = SQl
Me.AAAsubform.Requery
 
If you have the same line of SQL for numerous places then just make it a query and set the form's RecordSource to the query when necessary.

You also won't need the Requery line as assigning a RowSource automatically performs the query.
 

Users who are viewing this thread

Back
Top Bottom