DLookup problem

natsirtm

Registered User.
Local time
Today, 14:42
Joined
Apr 30, 2007
Messages
57
Can't for the life of me figure out why this won't work.

Simple DLookup
Code:
? DLookup("rid_Database", "tblDatabases", "[sDatabaseShortForm]='3CONP'")
rid_Database is valid field in table tblDatabases
3CONP is a valid entry within the field sDatabaseShortForm

all i get is ????????
 
Does the field rid_Database really have the underscore?

And sDatabaseShortForm is a field in tblDatabases?
 
Does 3CONP have a trailing space in the table..?
 
This produces a result...
Code:
Public Sub Blue()
Dim txt As String
Dim a() As Byte
 
    a = DLookup("rid_Database", "tblDatabases", "[sDatabaseShortForm]='3CONP'")
    txt = StringFromGUID(a)
    
End Sub
 
This produces a result...
Code:
Public Sub Blue()
Dim txt As String
Dim a() As Byte
 
    a = DLookup("rid_Database", "tblDatabases", "[sDatabaseShortForm]='3CONP'")
    txt = StringFromGUID(a)
 
End Sub

That looks good, thought I might need the GUID functions.
Out of curiousity, is the () for the byte variable required? What does it do?
 
Yes the () is required...

Declares a byte array instead of a byte...

The guid is stored as a byte array...
 
Ended up having to flip it back into a GUID declared variable and again to String (non jet), but ya put me on the right track. Thanks
 

Users who are viewing this thread

Back
Top Bottom