Christopher770
Registered User.
- Local time
- Today, 17:18
- Joined
- Sep 2, 2014
- Messages
- 18
UPDATE:
Update: I have been dicking around with this for 2 day's and still stuck (I'm being reminded of one of the definitions of a moron; keep doing the same thing over and over and expecting the same results)
Code:
Me.P1DMIL = (DLookup("[SWD]", "tblDSP010", ("[SWFROM] = '" & Forms!frmLHTEMPLATE!P1OT & " And [SWTO] = '" & Forms!frmLHTEMPLATE!P1DTID)))
Returns: Syntax error (missing operator)in query expression '[tblDSP010]![SWFROM] = 'ATL And [tblDSP010]![SWTO] = 'JCY'.
a) Notice the missing single quote in [SWFROM = 'ATL. {a clue}
================================================
I cannot believe this is that f'ing difficult and/or that there is not a better way to do this.
Simply put, I'm trying to look up a value in an unrelated table by using two combo boxes. After I get the values from the combo box, use that to look up the distinct record from another table and return a specific column
I'm frustrated, but humbly asking for some advice here.
ORIGINAL POST
==================================================================
• Data Entry Form based on table: tblLHTEMPLATE
• The form [frmLHTEMPLATE] has two combo boxes that lookup and return values from table: tblAAP030
o A: frmLHTEMPLATE!P1OT
o B: frmLHTEMPLATE!P1DTID
Problem: Form has an unbound control named [P1DMIL] to display a numeric value. I need to display a value from table:tblDSP010 based on the matching association from the forms combo boxes.
To do this I'm using a DLOOKUP as shown below: The problem is I'm getting a RunTime Error – Type Mismatch error. I've validated every control on the form and field in the tables. I'm suspect that the problem is my ignorance combined with a syntax error.
The Statement in an Event Statement set on "after update" of combo box B: frmLHTEMPLATE!P1DTID
==================================
Dim P1DMIL As Variant
Me.P1DMIL = (DLookup("[SWD]", "tblDSP010", ("[SWFROM] = " & Forms!frmLHTEMPLATE!P1OT And "[SWTO] = " & Forms!frmLHTEMPLATE!P1DTID)))
End Sub
===================================
My mind is now mush after 5 hours of dicking with this and realized I need to turn to the geniuses and beg for help.
Thank you in advance for anyone taking the time to weigh in on this!!
Christopher
Update: I have been dicking around with this for 2 day's and still stuck (I'm being reminded of one of the definitions of a moron; keep doing the same thing over and over and expecting the same results)
Code:
Me.P1DMIL = (DLookup("[SWD]", "tblDSP010", ("[SWFROM] = '" & Forms!frmLHTEMPLATE!P1OT & " And [SWTO] = '" & Forms!frmLHTEMPLATE!P1DTID)))
Returns: Syntax error (missing operator)in query expression '[tblDSP010]![SWFROM] = 'ATL And [tblDSP010]![SWTO] = 'JCY'.
a) Notice the missing single quote in [SWFROM = 'ATL. {a clue}
================================================
I cannot believe this is that f'ing difficult and/or that there is not a better way to do this.
Simply put, I'm trying to look up a value in an unrelated table by using two combo boxes. After I get the values from the combo box, use that to look up the distinct record from another table and return a specific column
I'm frustrated, but humbly asking for some advice here.
ORIGINAL POST
==================================================================
• Data Entry Form based on table: tblLHTEMPLATE
• The form [frmLHTEMPLATE] has two combo boxes that lookup and return values from table: tblAAP030
o A: frmLHTEMPLATE!P1OT
o B: frmLHTEMPLATE!P1DTID
Problem: Form has an unbound control named [P1DMIL] to display a numeric value. I need to display a value from table:tblDSP010 based on the matching association from the forms combo boxes.
To do this I'm using a DLOOKUP as shown below: The problem is I'm getting a RunTime Error – Type Mismatch error. I've validated every control on the form and field in the tables. I'm suspect that the problem is my ignorance combined with a syntax error.
The Statement in an Event Statement set on "after update" of combo box B: frmLHTEMPLATE!P1DTID
==================================
Dim P1DMIL As Variant
Me.P1DMIL = (DLookup("[SWD]", "tblDSP010", ("[SWFROM] = " & Forms!frmLHTEMPLATE!P1OT And "[SWTO] = " & Forms!frmLHTEMPLATE!P1DTID)))
End Sub
===================================
My mind is now mush after 5 hours of dicking with this and realized I need to turn to the geniuses and beg for help.
Thank you in advance for anyone taking the time to weigh in on this!!
Christopher
Last edited: