G
Guest
Hi all,
The setup is such cboVirus-->cboTest-->cboItem. The latter two combo boxes
are dependent on the preceding one, and have a column count of 2, (bound: 1),
where the second column is the test version or item version number.
When I write the code or go into the Row Source SQL statement and return to
the form, the numbers in the second column appear. And my code appears to
work. But as soon as I change the Virus chosen and/or the Test chosen, the
second column of the combo boxes are full of blanks.
I also would like the second column to autofill the Test Version and Item
Version bound objects on the form. Below is my code.
What is going on and how do I fix it?
Private Sub cboVirus_AfterUpdate()
'Sets up test combo box as being dependent on virus combo box AND limits to
RRT-PCR tests AND Status as In use'
'Note that the query in properties'
Me!cboTest.RowSource = "SELECT Test FROM lstTests WHERE Virus = '" &
cboVirus & "' AND Test Like '*RRT-PCR' AND Status Like 'In Use' "
End Sub
Private Sub cboTest_AfterUpdate()
'Sets up item combo box as being dependent on test combo box and etc'
Me!cboItem.RowSource = "SELECT lstItems.Item FROM lstItems WHERE
lstItems.Test = '" & cboTest & "' AND Status Like 'In Use'"
'Sets up autofill of Test Version'
Me!txtTestVersion.Value = cboTest.Column(1)
End Sub
Private Sub cboItem_AfterUpdate()
'Sets up autofill of Item Version'
Me!txtItemVersion.Value = cboItem.Column(1)
End Sub
Thanks all,
AG
The setup is such cboVirus-->cboTest-->cboItem. The latter two combo boxes
are dependent on the preceding one, and have a column count of 2, (bound: 1),
where the second column is the test version or item version number.
When I write the code or go into the Row Source SQL statement and return to
the form, the numbers in the second column appear. And my code appears to
work. But as soon as I change the Virus chosen and/or the Test chosen, the
second column of the combo boxes are full of blanks.
I also would like the second column to autofill the Test Version and Item
Version bound objects on the form. Below is my code.
What is going on and how do I fix it?
Private Sub cboVirus_AfterUpdate()
'Sets up test combo box as being dependent on virus combo box AND limits to
RRT-PCR tests AND Status as In use'
'Note that the query in properties'
Me!cboTest.RowSource = "SELECT Test FROM lstTests WHERE Virus = '" &
cboVirus & "' AND Test Like '*RRT-PCR' AND Status Like 'In Use' "
End Sub
Private Sub cboTest_AfterUpdate()
'Sets up item combo box as being dependent on test combo box and etc'
Me!cboItem.RowSource = "SELECT lstItems.Item FROM lstItems WHERE
lstItems.Test = '" & cboTest & "' AND Status Like 'In Use'"
'Sets up autofill of Test Version'
Me!txtTestVersion.Value = cboTest.Column(1)
End Sub
Private Sub cboItem_AfterUpdate()
'Sets up autofill of Item Version'
Me!txtItemVersion.Value = cboItem.Column(1)
End Sub
Thanks all,
AG