I have in the code
If Not IsMissing(FireEvent) Then
Call FireEvent_AfterUpdate
End If
baisically I am passing me.swaplist
I get an error when I pass me.swaplist as FireEvent
Can this be done?
I have in the code
If Not IsMissing(FireEvent) Then
Call FireEvent_AfterUpdate
End If
baisically I am passing me.swaplist
I get an error when I pass me.swaplist as FireEvent
Can this be done?
Can you show us more code where this resides? Not enough info or context for me.
Note the after update is a control afterupdate on the form and is a private subCode:Public Sub tagVisibility(DateFrom As Variant, DateUntil As Variant, TagName As String, FormImport As Form, Optional FireEvent As Variant) Dim ctl As Control If IsNull(DateFrom) Or IsNull(DateUntil) Then Debug.Print "Got to Here" For Each ctl In FormImport.Controls Select Case ctl.ControlType Case acComboBox, acTextBox, acCommandButton, acLabel, acListBox, acSubform If ctl.Tag = TagName Then ctl.Visible = False Else ctl.Visible = True End If End Select Next ctl Else For Each ctl In FormImport.Controls Select Case ctl.ControlType Case acComboBox, acTextBox, acCommandButton, acLabel, acListBox, acSubform If ctl.Tag = TagName Then ctl.Visible = True End If If Not IsMissing(FireEvent) Then Call FireEvent_AfterUpdate End If End Select Next ctl End If End Sub
calling the function
Call tagVisibility(Me.DateFrom_Box, Me.DateUntil_Box, "Vanish", Me.Form, Me.SwapList)
Not certain, but I think you have to reference the form on which control event is located????
Where is the FireEvent_AfterUpdate located? Me. ??
Yeah, It's on the end me.swaplist
I tried passing as control too
I've tried FormImport.refresh too
the afterupdate event has to fire because it gives me a count in a label caption after it has been updated. So I'd like it to have it's afterupdate event fired.
Call tagVisibility(Me.DateFrom_Box, Me.DateUntil_Box, "Vanish", Me.Form, Me.SwapList)
Try (guessing)
Call tagVisibility(Me.DateFrom_Box, Me.DateUntil_Box, "Vanish", Me, Me.SwapList)
If you know how to force the combo box to select something that could help fire the after update...
I've tried in the select case too
case vbComboBox
ctl.requery
but no luck
I found calling a control event only works on the forms vba and not in a module.....
See this link , seems others have done this. (found via Google)
Form_frmName.PublicSubName(anyVars)
Here is info from a recent email on another group
Here was a response, but I haven't heard success/failure yet..I have a command button on one form that opens a second form. On the second
form, I use a click event to enable and disable other controls based on the
value in the clicked event.
I'm also passing a value to the second form and using that to filter the
form's Recordset -- so the control that determines the disabling and
enabling has a selected value. I need to force that click to enable and
disable the other controls....
When I explicitly name the form in the Call statement, I get an error --
Call Forms![Enter Disposition Details]!lstDispositionDetailsID_Click()
Try:
Call Forms("Enter Disposition Details "). lstDispositionDetailsID_Click