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

Which Library???

Status
Not open for further replies.

aconakc

Technical User
Jan 9, 2001
42
0
0
US
Hi, Running OfficeXP. I've been trying for weeks now to modify some of Microsoft's sample modules to fit my database with little luck. It appears that even basic "objects" are missing from the libraries. for example;
"DIM abc as recordset" sometimes results in a "user-defined type undefined" error. Or in one module it actually gets past that statement but then
"Set rstTemp = .OpenRecordset(dbOpenSnapshot)" produces an instead. Any ideas. Is there a library reference that should be checked but maybe isn't??? Sounds like pretty basic commands but I can't seem to get past them.

Thanks,
aconakc
 
Ensure the Microsoft DAO 3.# Object Library is checked (in VBE - Tools | References), and explicitly declare any DAO objects

[tt]dim rs as dao.recordset
dim db as dao.database
dim qd as dao.querydef
...[/tt]

Roy-Vidar
 
Thanks Roy-Vidar

That solved some problems... Another question...

Can you have a "where" statement in a sql within a querydef statement??

for example:

Set qdftemp = CurrentDb.CreateQueryDef("")
With qdftemp
.SQL = "SELECT Name, loginid, field1, field2, FROM Data_Table1 where Field1 >= Forms!Reports_Switchboard.startreport"

End With

If I run this without the "where" portion it runs fine, but when I run it with the "where" portion it freezes.

Any more suggestions would be appreciated.
thanks in advance

aconakc

 
I think you need:

"SELECT Name, loginid, field1, field2, FROM Data_Table1 where Field1 >= " & Forms!Reports_Switchboard.startreport

Bev
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top