Hi,
Based on previous help here (hi ntp! ), I’m now properly retrieving a control name for storage in a variable in a class module. Problem is that when I use the variable to access a control property I get an ‘object required run time error 424’ which says I’m
“References to properties and methods often require an explicit object qualifier.”
Well cud someone mention a way around this? As I thought this was a valid way to store a control name that may or may not change from time to time and whose subsequent properties need to be accessed by a function.
Private Sub cmbDist_Reset()
If cmbDist = "Jonic" And cmbType = "Back end" Then
"Use the JTS system instead." _
& Chr(13) & _
"Otherwise, enter a different distributor.",
vbExclamation, "Error"
CtrlName.SetFocus
Else
Exit Sub
End If
End Sub
The problem line above occurs right before the else statement, CtrlName.Setfocus is failing although ctrlname is defined in the class as a private variant and CtrlName is first determined by the 2 functions below before going to the cmbDist_reset function I mentioned above. Wud appreciate you great peoples help.
Private Sub cmbDist_AfterUpdate()
If cmbDist = "Jonic" Then
CtrlName = cmbDist.Name
Call cmbDist_Reset
End If
End Sub
Private Sub cmbType_LostFocus()
If cmbType = "Back end" Then
CtrlName = cmbType.Name
Call cmbDist_Reset
End If
End Sub
I’ve learned a lot from you folks thank you very much, but I guess I have a ways to go before I’m sufficiently able to work on my own, but I’m getting there for sure w/your help.
Thanks!
Based on previous help here (hi ntp! ), I’m now properly retrieving a control name for storage in a variable in a class module. Problem is that when I use the variable to access a control property I get an ‘object required run time error 424’ which says I’m
“References to properties and methods often require an explicit object qualifier.”
Well cud someone mention a way around this? As I thought this was a valid way to store a control name that may or may not change from time to time and whose subsequent properties need to be accessed by a function.
Private Sub cmbDist_Reset()
If cmbDist = "Jonic" And cmbType = "Back end" Then
"Use the JTS system instead." _
& Chr(13) & _
"Otherwise, enter a different distributor.",
vbExclamation, "Error"
CtrlName.SetFocus
Else
Exit Sub
End If
End Sub
The problem line above occurs right before the else statement, CtrlName.Setfocus is failing although ctrlname is defined in the class as a private variant and CtrlName is first determined by the 2 functions below before going to the cmbDist_reset function I mentioned above. Wud appreciate you great peoples help.
Private Sub cmbDist_AfterUpdate()
If cmbDist = "Jonic" Then
CtrlName = cmbDist.Name
Call cmbDist_Reset
End If
End Sub
Private Sub cmbType_LostFocus()
If cmbType = "Back end" Then
CtrlName = cmbType.Name
Call cmbDist_Reset
End If
End Sub
I’ve learned a lot from you folks thank you very much, but I guess I have a ways to go before I’m sufficiently able to work on my own, but I’m getting there for sure w/your help.
Thanks!