开发者

How can i use a record i found in database to perform other operations

开发者 https://www.devze.com 2023-04-12 04:10 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号