How to change the Recordset of a form?

N

Niels

Hello Bish,
thanks for your comment ...
Well I use Access 97 and it seems to me that the Form have
no property named "Recordset".

It i try to change the recordset with the following code

Dim db As Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.QueryDefs("Abfrage1").OpenRecordset
Me.Recordset = rs

I get a error message because Me.Recordset wasn't
availible.

Do you have an code snipplet for Access 97 please ?

Thanks in advance for your help.
Niels
 
M

Michel Walsh

Hi,


In Access 97, probably the easiest way would be to write the SQL code as a string:

mySQL=" SELECT ...WHERE fieldName= " & myVariable

and assign that string to the recordsource:

Me.Recordsource=mySQL


since Access 97 Forms have no Recordset property.


Hoping it may help,
Vanderghast, Access MVP
 

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