Hello everyone.
I've been requerying a bunch of ComboBoxes in my forms using the after update event of the ComboBox they depend on, it looks like this:
I have this pattern everywhere, is there a way to wrap these lines like CustomRequery(combo)? or something like that?
I was trying with
First of all, I don't know what the output type should be. Second, I don't know how to refer to the form "me".
Also, if none of this makes sense, I'd like to know.
Thank you all.
I've been requerying a bunch of ComboBoxes in my forms using the after update event of the ComboBox they depend on, it looks like this:
Code:
Private Sub cboMain_AfterUpdate()
Me.Combo1.Requery
If Trim(Me.Combo1& "") = "" Then
Me.Combo1= Me.Combo1.ItemData(0)
End If
Me.ComboTwo.Requery
If Trim(Me.ComboTwo& "") = "" Then
Me.ComboTwo= Me.ComboTwo.ItemData(0)
End If
End Sub
I have this pattern everywhere, is there a way to wrap these lines like CustomRequery(combo)? or something like that?
I was trying with
Code:
Public function CustomRequery(combo as Access.ComboBox) as ?
'the code
End function
First of all, I don't know what the output type should be. Second, I don't know how to refer to the form "me".
Also, if none of this makes sense, I'd like to know.
Thank you all.