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!

Open Recordset Problem 1

Status
Not open for further replies.

VTbigwillie

Programmer
Jul 23, 2002
9
US
I am having a problem with the line of code:
Set rs = CurrentDb.OpenRecordset("tblShopper", dbOpenDynaset)

In my previous database, that line of code worked perfectly but since creating a new database, I can not get this line of code to work (it states type mismatch)

Is there a setting that I need to enable or disable in order for this to work?

Thanks in advance,
Will
 
Have you check the Set of the CurrentDb object. Alse make sure that the table is created, or if the previous database had a TableDef to create the table before you could use it.

You may have a line like
[code[Set CurrentDb = Dbengine.workspaces(0).databases(0) [/code] somewhere for your record set to open.

Hope this pointer helps,
HAH
 
Make sure you have the following references libs checked. In design view of a form, do ALT + F11 to go into VB. Click on Tools and then References. Make sure the following is checked, especially the DAO Libraries:

Microsoft DAO 3.6 Library
Microsoft ActiveX Data Object 2.5 Library
Microsoft ActiveX Data Object Recordset 2.5 Library
Ole Automation
Microsoft ActiveX Plugin
Visual Basic for Applications
Microsoft Accesss 9.0 Object Library
ACWZMAIN
Microsoft Visual Basics for Applications Extensibility 5.3

No one tells you all this is needed to do VBA for Access.

Neil
 
I just found out that I have to do my development in Access 2000 instead of XP and that has changed my Microsoft Access library from 9.0 to 10.0 which takes out the .addItem and .removeItem function from my listboxes....Is there a way to get these back with the 9.0 object library?
 
Well, if you're on Access 2k you can leave DAO behind and now use ADO - which will make life a lot easier for you.


G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top