Setting Recordsource for a form

jonesda

Registered User.
Local time
Today, 10:18
Joined
Sep 13, 2005
Messages
36
Hi,

I am creating a generic search form [FormSearch], which allows users to select different data options and then display the results of the query in a new form [FormAnswer].

When the search button is clicked on FormSearch I:
- construct my SQL Query, which works okay
- set the recordsource of FormAnswer to the query statement using code FormAnswer.RecordSource = strQuery
- Open the FormAnswer form

On the FormAnswer form I have bound the fields to the relevant fields of the table, which I am querying.

My problem is that the records returned by the quer are not being displayed on the FormAnswer form. I'm not sure why. the fields on the form are bound and I have set the record source before I open the form.

Is there something else I need to do when setting the record source for a new form I am opening?

Any help / ideas would be greatly appreciated.

Thanks
 
I dont think you can set the record source of a form before you open it! try opening and then setting the source

HTH

Peter
 
Thanks a million Peter for your help.

That was the problem.
 

Users who are viewing this thread

Back
Top Bottom