FindRecord won't work

RobinL

Registered User.
Local time
Today, 11:44
Joined
Mar 27, 2002
Messages
27
I have a form that is based on table that comprises of the information for a hospital concerning the loans of equipment.

The form's aim is to let the form user change the status of an item from in stock to on loan, and change the other field in the record (e.g. enter the start of loan period etc)

Each piece of equipment has a unique item code.

I have a combo box based on a query that shows only one instance of each item (i.e. if there are three small wheelchairs in stock it will only show the first instance).

The form is based on the main table of items (but the combo box takes information from a query).

All I want to do is use the FindRecord action to jump to the item (e.g. wheelchair) that the user selects the item from the combo box and then clicks a command button.

At the moment when I click the button to activate the findrecord command I get errors - basically either its not searching the main table or something else.

Any ideas on why the macro isn't working?

(sorry about the explaination its not brilliant but i'm pretty new to this
frown.gif
)

Rob
 
Before you do the search, be sure the focus is in the form's control that's tied to the field you're searching.

That is, if you are expecting the user's search string to be found in the EquipName field of the Equipment table, and the form has a text box named tbxEquipName with this field as its recordsource, you need to execute something like

DoCmd.GoToControl "tbxEquipName"

just before the DoCmd.FindRecord.

Suggest you look at doing this in VBA rather than Macros so you can provide a more descriptive error message in case the user's search string fails to find a hit.

I found macros helpful many years ago when just getting started, and they DO kind of get you used to programming in Access, but VBA provides a lot more control and power to you as a developer.

Jim
 

Users who are viewing this thread

Back
Top Bottom