R
R. Choate
I need to return a single value from a 2-column persisted recordset (.dat
file). I've been trying to use a dlookup function without success. My
recordset fields are "Ticket" and "Weight", and I need to retrieve the
weight value which corresponds to a ticket number (text data type) which
matches the text in the "txtTkt" field on my open Access user form. I know
that the recordset exists, contains the correct data, and is open. Here is
my bad code that is within the class module for my form:
rst.CursorLocation = adUseClient
rst.Open "C:\Path\Somedata.dat", , adOpenStatic, adLockBatchOptimistic
X = Me.txtTkt
J = DLookup("Weight", rst, "Ticket = " & X)
file). I've been trying to use a dlookup function without success. My
recordset fields are "Ticket" and "Weight", and I need to retrieve the
weight value which corresponds to a ticket number (text data type) which
matches the text in the "txtTkt" field on my open Access user form. I know
that the recordset exists, contains the correct data, and is open. Here is
my bad code that is within the class module for my form:
rst.CursorLocation = adUseClient
rst.Open "C:\Path\Somedata.dat", , adOpenStatic, adLockBatchOptimistic
X = Me.txtTkt
J = DLookup("Weight", rst, "Ticket = " & X)