Automating the selection of a list box value on a form (1 Viewer)

PaulJR

Registered User.
Local time
Today, 03:25
Joined
Jun 16, 2008
Messages
133
I am trying to find some form of VBA code that will automatically select an appropriate (default) item in a list box.

I can't use the 'default value' property as whats displayed in the list box is different depending upon other selected fields on the form.

Could somebody please help? I'm guessing this is really simple but I haven't had any success finding anything.

Paul
 

DCrake

Remembered
Local time
Today, 03:25
Joined
Jun 8, 2005
Messages
8,626
How are you defining what the selection should be?

Can you eleborate
 

PaulJR

Registered User.
Local time
Today, 03:25
Joined
Jun 16, 2008
Messages
133
This is one example of a list box that has the following SQL statement in the Row Source property of my list box:

SELECT TestLocations.TestLocation
FROM TestLocations INNER JOIN HardwareTestTypes ON TestLocations.TestLocation = HardwareTestTypes.TestLocation
WHERE (((HardwareTestTypes.MfgCell)=[Forms]![Front Page]![MfgCell]) AND ((HardwareTestTypes.Hardware)=[Forms]![Test Records]![HardwareType]))
ORDER BY TestLocations.count;

I don't really use SQL. But what I'm basically doing is filtering what is displayed in the 'Test Location' list box depending upon what was selected in a 'Hardware Type' Combo Box.

The operator has to select the Hardware Type before they can select a Test Location. Now as each piece of hardware is tested in a variery of different locations, I would like to have the option of trying to get the Test Location list box to automatically have a default value selected.

As this database is used in a busy manufacturing environment, I am trying to make the form as easy as possible for operators to fill in.

Sorry I'm making this difficult to understand I bodged this database together a year ago.
 

Users who are viewing this thread

Top Bottom