Syntax Question

  • Thread starter Thread starter oldblindpew
  • Start date Start date
O

oldblindpew

What is wrong with this line from a form's On Load event?

rst.FindFirst "tNameFirm Like A*"

I'm getting "Syntax error (missing operator) in expression, and as usual, I
can't seem to solve my own problem by looking up the syntax, which bugs me to
no end.

I'm trying to get a form to open with the first record by firm name in
alphabetical order, rather than just opening to record number 1. I don't
like this way of doing it, but I don't know what else to try.

Thanks
 
hi,
What is wrong with this line from a form's On Load event?

rst.FindFirst "tNameFirm Like A*"
The search term itself must be a sting enclosed in quotes, e.g.

rst.FindFirst "tNameFirm Like 'A*'"


mfG
--> stefan <--
 
What is wrong with this line from a form's On Load event?

rst.FindFirst "tNameFirm Like A*"

I'm getting "Syntax error (missing operator) in expression, and as usual, I
can't seem to solve my own problem by looking up the syntax, which bugs me to
no end.

I'm trying to get a form to open with the first record by firm name in
alphabetical order, rather than just opening to record number 1. I don't
like this way of doing it, but I don't know what else to try.

Thanks

If all you wish to do is always open to the first firm name
alphabetically, why not just sort the records alphabetically.
Code the form's Open event:
Me.OrderBy = "[CompanyName]"
Me.OrderByOn = true

Whenever you wish to go back to the original order, just right-click
on the form and select Remove Filter/sort.
 
Back
Top