Try:
DLookUp("Inspection_Tool","tblValidPartDimensions",
"Dimension_No = """ & [txtDimension_No] & """")
Explanation:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
Note that this assumes that Dimension_No is a Text field if you open
tblValidPartDimensions in design view. If it is a Number field, see:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"GD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Seemingly quick question using an A2K database. Here is my Dlookup
> statement (Inserted into the control source for a text box):
>
> DLookUp("Inspection_Tool","tblValidPartDimensions","Dimension_No =
> ' " & [txtDimension_No] & " ' ")
>
> It returns the values I want just fine, except for one scenario. If
> the string in txtDimension_No has a single quote in in ( ' ), then it
> returns #Error. So imagine if it said something like O'Riley.
>
> How can I rework my DLookUp statement to fix this? Thanks.