This is in the after update event of the First combobox,
On Error Resume Next
cboSub.RowSource = " SELECT DISTINCT ItemMaster.Sub " & _
" FROM ItemMaster " & _
" WHERE ItemMaster.ItemNumber = '" & cboItemNumber.Value & "'" & _
" ORDER BY ItemMaster.Sub;"
Everything works as it should except that i need to get rid of null values
in the second combobox. I need to see that there is data in the [sub] field
to choose from when entering data. I also have this code in the on focus
event of the second combobox.
Me.cboSub = Me.cboSub.ItemData(0)
If i change it to (1) it gets me what i need except when there are not nulls
in the [sub] field.
Any and all assistance is greatly appreciated.
Thank you, Asib
If you want to exclude Null values in the Sub field, do you
get what you want by changing the row source:
cboSub.RowSource = " SELECT DISTINCT Sub " & _
" FROM ItemMaster " & _
" WHERE ItemNumber = '" & cboItemNumber.Value & "'" & _
" AND Sub Is Not Null " & _
" ORDER BY Sub"
I am noit sure I understand what you are saying about about
ItemData(0). It should work(?) as long as the ColumnHeads
property is set to No
--
Marsh
MVP [MS Access]
"Marshall Barton" wrote:
> .
>