Syntax Question

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
 
S

Stefan Hoffmann

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 <--
 
F

fredg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top