I'm using MS Access 2003.
I have a form whose underlying Control Source (query) returns the column "TugArchiveDetailId". From within VBA, should I be able to access the value stored in this field and make decisions based on it?
I can access the value if I put it on the form as an invisible textbox, but not when accessing the column value directly.
Weird thing is that I have another column on the same record that I *can* access directly. I've double- and triple-checked the name of the columns.
Here's the code:
This command button is on each record of a continuous form.
In the above code, the debug line
says that the value is zero, whereas the corresponding textbox displays '1'.
The message box displays:
CSR Archive ID = 1
TUG Archive ID =
I'd prefer not to create invisible fields if it's unnecessary.
Any idea where I'm going wrong?
Thanks for any help you can give.
Wayne
I have a form whose underlying Control Source (query) returns the column "TugArchiveDetailId". From within VBA, should I be able to access the value stored in this field and make decisions based on it?
I can access the value if I put it on the form as an invisible textbox, but not when accessing the column value directly.
Weird thing is that I have another column on the same record that I *can* access directly. I've double- and triple-checked the name of the columns.
Here's the code:
Code:
Private Sub cmdRestageRecord_Click()
On Error GoTo ErrorHandler
Dim lngTugArchiveDetailId As Long
lngTugArchiveDetailId = TugArchiveDetailId
MsgBox "CSR Archive ID = " & CsrArchiveDetailId & vbCrLf & "TUG Archive ID = " & TugArchiveDetailId
CleanUpAndExit:
Exit Sub
ErrorHandler:
MsgBox Err.Description
Resume CleanUpAndExit
End Sub
This command button is on each record of a continuous form.
In the above code, the debug line
Code:
lngTugArchiveDetailId = TugArchiveDetailId
The message box displays:
CSR Archive ID = 1
TUG Archive ID =
I'd prefer not to create invisible fields if it's unnecessary.
Any idea where I'm going wrong?
Thanks for any help you can give.
Wayne