Greetings. I have a small issue that I'm sure will be a simple fix. I have a form with two radio buttons (by $ and by %). If the user selects "by $", then the % text boxes are grayed out, and vice versa for "by %". The code works as intended as I step through it. However, once I assign the code to a macro, I get the error "This object doesn't contain the Automation object Select_Invoice_Amount_Type". I tried to assign it to various events: on load, on click, after update...all get the same message. I then just assigned it to a command button, thinking the automation piece might be resolved...still same error. I'm sure I'm just overlooking something. Any help is appreciated.
Module:
Function Select_Invoice_Amount_Type()
With Forms.frm_Add_Invoice_Test
If .grp_Select_Type = 1 Then
.txt_dollar_1.Enabled = True
.txt_percent_1.Enabled = False
Else
.txt_dollar_1.Enabled = False
.txt_percent_1.Enabled = True
End If
End With
End Function
Macro
Function mcr_Option_Select()
On Error GoTo mcr_Option_Select_Err
mcr_Option_Select_Exit:
mcr_Option_Select_Err:
End Function
Module:
Function Select_Invoice_Amount_Type()
With Forms.frm_Add_Invoice_Test
If .grp_Select_Type = 1 Then
.txt_dollar_1.Enabled = True
.txt_percent_1.Enabled = False
Else
.txt_dollar_1.Enabled = False
.txt_percent_1.Enabled = True
End If
End With
End Function
Macro
Function mcr_Option_Select()
On Error GoTo mcr_Option_Select_Err
Call Select_Invoice_Amount_Typemcr_Option_Select_Exit:
Exit Functionmcr_Option_Select_Err:
MsgBox Error$
Resume mcr_Option_Select_ExitEnd Function
Last edited: