How can i use a record i found in database to perform other operations
I was searching for a record in my d开发者_如何学JAVAatabase and now that the record is found I want to know how can I use it for example if i want to use the name field of the record to put in text
If rsQ.RecordCount <> 0 Then
' Found it
blnExists = True
NameTxt.Value = Name.Value
Else
MsgBox "not found"
End If
It gives me an Invalid qualifier at this line
NameTxt.Value = Name.Value
You say VBA but not which database you are using. From the above, it looks like you would be better off with DLookUp in Access. Otherwise, you can say:
MyVar = rsQ.Fields("[Name]")
Or
MyVar = rsQ.Fields(3)
BTW Name is a reserved word and should not be used.
精彩评论