I am fairly new to Access. I have 2 issues
(1)
I was creating a form wherein I need to capture values from a Table based on some key fields SONo (Text), ErpFGCode (Text), DiscountRate (calculated number)
In the Form there is an unbound text box where I used the formula as below. SONo is a field in the Form (SOInvfrm) and also in the table CustSOTbl. Idea is to locate the MewarInvUnit in CustSOTbl where SONo captured in the SOInvfrm, matches with the SONo in the CustSOTbl
=DLookUp([CustSOTbl]![MewarInvUnit],[CustSOTbl]![SONo]="& [SONo] "). I got an error #Name? in the form view. No compilation error. On checking different sites, I changed the formula as below
=DLookUp([CustSOTbl]![MewarInvUnit],[CustSOTbl]![SONo]= '"&[SONo]&"'"). This gives a syntax error!!
(2)
In the same form I want to locate the DiscountRate from the table (this is a calculated field - Rate*Discount in the table). The SoNo is common for several items (ErpFGCode) in the CustSOTbl and each item has a different rate. Therefore I need I need to search for the rate based on concatenated string SONo+ErpFGCode. I tried several formulas but get a compilation error with all
=DLookUp([CustSOTbl]![DiscountRate],"([CustSOTbl]![SONo])" & "([CustSOTbl]![ErpFGCode] )"= " & "[SONo] & [ItemCode]")
=DLookUp([CustSOTbl]![DiscountRate],"([CustSOTbl]![SONo])" & "([CustSOTbl]![ErpFGCode] )"= " & "([SONo] & [ItemCode])")
=DLookUp([CustSOTbl]![DiscountRate],"([CustSOTbl]![SONo])" & "([CustSOTbl]![ErpFGCode] )"= " & ("[SONo]" & "[ItemCode]"))
I want to then eventually multiply quantity field of the form with the above rate fetched from the table
=[QtySent]*[ItemRate]
Please help a novice find his feet