SteveL13
asked on
Syntax error on this line of code when the text of EquipName has an apostrophe in it
I'm getting a syntax error on this line of code when the text of EquipName has an apostrophe in it like "16' BLACK UTILITY"
Me.txtEquipment = DLookup("[Equip Name]", "Equipment", "[Equip Name] = '" & Forms!frmScheduleWorkOrder !subfrmSch eduleEquip ment.Form! txtEquipNa me & "'")
Me.txtEquipment = DLookup("[Equip Name]", "Equipment", "[Equip Name] = '" & Forms!frmScheduleWorkOrder
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jim, your solution worked but I just discovered I get the syntax error message when EquipName has " marks in it.
ASKER
Daniel, I can't get your solution to work at all. I'm sure I'm doing something wrong.
You'll need to use Daniel's approach then of doubling up on the delimiter.
his code should go in a standard module.
Jim.
his code should go in a standard module.
Jim.
Me.txtEquipment = DLookup("[Equip Name]", "Equipment", "[Equip Name] = " & chr$(34) & Forms!frmScheduleWorkOrder
Jim.