BillieBurgess
Technical User
Hello,
I found 10 or 8 other posts but could still not figure out what I am doing wrong. So if someone would be so kind as to look at my criteria and help me figure out what is missing I would sincerely appreciate it.
I have Access 2002. I am the writer of this programs so all errors are mine.
I need to auto populate a serial number into a bound control in a form. I was using a Combo box with the query such that only the correct s/n comes up. But then you have to select it and that got old fast. So by searching this site I came across Lookup. It sounds perfect, but it just will not work.
Okay there is one table and two Criteria
My Code is as follows:
Private Sub Serial_number_GotFocus()
On Error GoTo Err_Serial_number_GotFocus
Dim txt As TextBox
Set txt = Forms![Entry Trip DM]![Subform Trip Reimbursements].Form![Serial number]
txtvalue = DLookup("[Serial#]", "[Dish Defective unit]", "[Dealer ID]='" & [Forms]![Entry Trip DM]![Dealer ID] & " AND [Dish RA #]='" & [Forms]![Entry Trip DM]![Subform Trip Reimbursements].[Form]![RA #].[Value] & "'"
Err_Serial_number_GotFocus:
MsgBox Err.Description
Exit Sub
End Sub
Thank you very much for your Help
I found 10 or 8 other posts but could still not figure out what I am doing wrong. So if someone would be so kind as to look at my criteria and help me figure out what is missing I would sincerely appreciate it.
I have Access 2002. I am the writer of this programs so all errors are mine.
I need to auto populate a serial number into a bound control in a form. I was using a Combo box with the query such that only the correct s/n comes up. But then you have to select it and that got old fast. So by searching this site I came across Lookup. It sounds perfect, but it just will not work.
Okay there is one table and two Criteria
My Code is as follows:
Private Sub Serial_number_GotFocus()
On Error GoTo Err_Serial_number_GotFocus
Dim txt As TextBox
Set txt = Forms![Entry Trip DM]![Subform Trip Reimbursements].Form![Serial number]
txtvalue = DLookup("[Serial#]", "[Dish Defective unit]", "[Dealer ID]='" & [Forms]![Entry Trip DM]![Dealer ID] & " AND [Dish RA #]='" & [Forms]![Entry Trip DM]![Subform Trip Reimbursements].[Form]![RA #].[Value] & "'"
Err_Serial_number_GotFocus:
MsgBox Err.Description
Exit Sub
End Sub
Thank you very much for your Help