This is not a question, but rather an informational post about something I just solved. My issue was that I'm trying to use
- rst.FindFirst (str1 & " = '" & txtLastNameSearch.Value & "'")
-
My goal was to search through a table with a field
fldNameLast, but only compare the leftmost
int1 characters in this field to my text box value (
txtLastNameSearch.Value). So originally I tried something like
- str1 = "Left([fldNameLast],int1)"
But the VB compiler complained about the use of
int1 (which is set earlier in the code). After playing around with it for a while, I settled on
- str1 = "Left([fldNameLast]," & int1 & ")"
And this works very well, at least for all the values of txtLastNameSearch.Value that I've tried so far. Seems like the main rule is to keep variables outside the quotes...