Referring to a text field in SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

This function with SQL statement parameter works fine when the field MRN is
a number field but it does not work when MRN is a text field. How do I refer
to the field in the SQL statement when it is a text field? Thanks.

ConcatDx("SELECT [Procedure(s)] FROM qryConcatProc WHERE MRN =" &
TblPatient.MRN)
 
Steve

Text needs to be delimited. You could try something like:

WHERE MRN ='" & TblPatient.MRN & "'"
(single quote marks)

If those don't work, you might try using double-quote marks (but this gets a
bit trickier, as you need to add multiple "s).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Back
Top