|
-
Oct 19th, 1999, 04:22 PM
#1
Thread Starter
Member
Can someone tell me why i keep getting error for this code? Thks.
"Object variable or With variable not set"
With Data3
.RecordSource = "select * from " & LTrim(Text70.Text) & "'"
.Recordset.MoveFirst
.Refresh
End With
-
Oct 19th, 1999, 07:12 PM
#2
Addicted Member
the error is not in the query, but in the object you are using (Data3)
First of all, you need to 'set' the object.
I presume you did:
dim Data3 as adodb.recordset
Now you have to initialize it, by coding:
set Data3 = new adodb.recordset
You can do this right in this part of code, or in the form load event or somewere else.
-
Oct 19th, 1999, 09:44 PM
#3
Guru
if data3 is a db control, then make sure the databasename property is set. After assigning SQL to your recordsource, then refresh, then movefirst. You are moving first then refreshing. the SQL doesn't really execute until you issue a refresh command.
HTH
Tom
-
Oct 20th, 1999, 08:41 AM
#4
Thread Starter
Member
Thks guys, for all your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|