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

rs.field question

Status
Not open for further replies.

dominiopt

Technical User
Joined
Sep 10, 2001
Messages
75
Location
PT
why this variable definition are failing ?

If Combo1.Text = wd1 Then
dbCampo = "Secção"
End If

Set rs = db.OpenRecordset("SELECT * FROM " & dbTabela & "")
Do While Not rs.EOF
'record = "" & rs!Fields("dbCampo") ---> This gives error
'record = "" & rs!Secção '-------------> This works fine
If record <> &quot;&quot; Then
List1.AddItem record
End If
rs.MoveNext
Loop
rs.Close

Thanks
Fernando
 
record = &quot;&quot; & rs(&quot;dbCampo&quot;) ---> change to this David Paulson

 
make it...
record = &quot;&quot; & rs.Fields(&quot;dbCampo&quot;)
 
Thanks to all helping people.
Fernando
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top