Invalid use of Me keyword

My database won't compile because of this line...

    strSQL = "SELECT DISTINCT tblLOCALTempDrChromoPatientAndMedImport.ChronoID, tblLOCALTempDrChromoPatientAndMedImport.Class FROM tblLOCALTempDrChromoPatientAndMedImport WHERE tblLOCALTempDrChromoPatientAndMedImport.ChronoID = '" & Me.txtChronoID & "'"

It says "Invalid use of me keyword"

??
SteveL13Asked:
Who is Participating?
 
als315Connect With a Mentor Commented:
You can use Me keyword only in Form's module. If it is stand-alone module, you should use full name of your form like:
Forms!MyFormName!txtChronoID
0
 
Mike EghtebasDatabase and Application DeveloperCommented:
if it is in a form code window, also try

Me!txtChronoID
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.