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 wOOdy-Soft 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
Sep 10, 2001
75
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top