How to change the Recordset of a form?

  • Thread starter Thread starter Niels
  • Start date Start date
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
 
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
 
Back
Top