On one of my forms, I simply have one combo box that will update another combo box based on information in a table. However, there will be times that the information being entered will not be on the table as it is not a reoccurring item. How do I stop these instances from causing a debug error when it doesn't match the data on the table? Is there an End If statement I could use? Here's my code:
Private Sub Combobox1_BeforeUpdate(Cancel As Integer)
Me.Combobox2.Requery
'me.Combobox2 = Me.Combobox2.ItemData()
End Sub
Private Sub Combobox1_AfterUpdate()
Me.Combobox2.Requery
Me.Combobox2 = Me.Combobox2.ItemData(0)
End Sub
Private Sub Combobox1_BeforeUpdate(Cancel As Integer)
Me.Combobox2.Requery
'me.Combobox2 = Me.Combobox2.ItemData()
End Sub
Private Sub Combobox1_AfterUpdate()
Me.Combobox2.Requery
Me.Combobox2 = Me.Combobox2.ItemData(0)
End Sub