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

Error with Me.Recordsource

Status
Not open for further replies.

Axoliien

Programmer
Aug 19, 2003
166
US
I have created a form that has no bound objects. On form load I create a recordset, query a specific record from the database, and then disconnect the recordset. I then bind the current record to my form, in effect creating a bound form that handles exactly one record. This allows the user to change values and all I have to do is verify data is valid and then run a recordset update.

My problem is this: the form runs perfectly in MS Access 2002 and greater, but with MS Access 2000 I get an error that says "This is not a valid operation" to binding the recordset to the form recordsource. I have updated all computers to MDAC 2.8, is there any workaround around this other than changing the code to run calls to stored procedures or SQL UPDATE statements?

Code:
'create recordset rset, query it, disconnect it, etc
Me.RecordSource = rset
 
No discrepancy or ambiguity between DAO and ADO recordsets ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I only use ADO in my programs since I really just started programming with Visual Basic a few months ago, but I double checked and my code seems fine.

Upon suggestion from a coworker I tried to bind a query client-side to the form without using disconnected recordsets, and it still will not bind.

Code:
Me.RecordSource = "qry_EditAcctAssmt"

Still did not work.
 
In Access 2000 the recorsource will take an SQL statement as the source.

Me.RecordSource = "select * from table"

For a recordset use.
Set Me.Recordset = rset

In 2000 this will probably not be updateable, but it can be made updateable by using the MSDATASHAPE provider instead of the OLE provider for the database. Perhaps do a search on MSDATASHAPE on this Forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top