Combo box updating by selected record

wordsmith

Registered User.
Local time
Today, 13:01
Joined
Jan 30, 2006
Messages
33
Hi all,

I have created a form to enter downtime information using the fields from downtime table (as follows)

tblDowntimes

fldDowntimeID (PK)
DateOccured
MaterialCode
ShiftID (FK)
LineMachineID (FK)
DTCategoryID (FK)
DTReasonID (FK)

However on the form, LineMachine is taken from the tblLineMachine where LineID and MachineID are FKs. This has a large list of machines as one line can have many machines and a machine may appear on more than one line

So on the form, i would like to select the LineMachineID by inserting fldLineID (which would be a combo box) where the user could select which line e.g. Line1 and then the combo box for the LineMachineID would only display the relevant machines for the entered line instead of all the machines for every line.

I managed to achieve this,but I am experiencing a problem where if, in the Line combo box, i choose a different Line e.g. Line2, the LineMachineID does not then display the machines on Line2, but keeps showing the machines for the line I originally selected (Line 1).

How do I get the LineMachineID combo box to update every time a different line is chosen in the LineID combo box?

Any assistance much appreciated!!

thanx all,

Keji
 
Requery your second combobox when you change your first combobox
me.Combobox2.requery
Usually you can do this in the click event of the first combobox.
 
Hey FoFa,

thanks so much for replying

so do you mean in the combobox for the LineMachine, in the onclick event,
enter

me.LineMachine.requery

or do i enter that in the onclick event for the Line combobox?

regards

Keji
 

Users who are viewing this thread

Back
Top Bottom