B
Bill Fischer via AccessMonster.com
I'm sure I must be missing something simple but I cannot set the focus on a
combo box on a main form control with an event from a subform control at
gotfocus. Run-time error '438': Object doesn't support this property or
method.
I have searched the threads and have nothing pertaining to an issue like this
(maybe just not entering correct key words). Have been trying to correct
this issue since last night and it is driving me over the edge.
My code on first control in subform checks for null or a default value in the
main form if the value is either of those a msgbox will tell user it must
have a value. Problem comes when I try to set focus to the main form control
combo box.
To check for proper language I set the combo box to a text box, then ran
event with same setfocus statement and it works perfectly. Is there a
different reference for a combo box or issue with source property I am not
using correctly? The source query field is a combo box and wondering may
that be the issue?
My code is:
Private Sub Invoice_Number_GotFocus()
If Not IsNull(Me.Parent![BUSINESS NAME]) Then
If Me.Parent!CodingID = 1137468902 Or IsNull(Me.Parent!CodingID) Then
MsgBox "You must enter a Category", vbInformation, "MISSING CATEGORY"
Me.Parent!CodingID.SetFocus
End If
End If
End Sub
Many thanks for any help.
Bill
combo box on a main form control with an event from a subform control at
gotfocus. Run-time error '438': Object doesn't support this property or
method.
I have searched the threads and have nothing pertaining to an issue like this
(maybe just not entering correct key words). Have been trying to correct
this issue since last night and it is driving me over the edge.
My code on first control in subform checks for null or a default value in the
main form if the value is either of those a msgbox will tell user it must
have a value. Problem comes when I try to set focus to the main form control
combo box.
To check for proper language I set the combo box to a text box, then ran
event with same setfocus statement and it works perfectly. Is there a
different reference for a combo box or issue with source property I am not
using correctly? The source query field is a combo box and wondering may
that be the issue?
My code is:
Private Sub Invoice_Number_GotFocus()
If Not IsNull(Me.Parent![BUSINESS NAME]) Then
If Me.Parent!CodingID = 1137468902 Or IsNull(Me.Parent!CodingID) Then
MsgBox "You must enter a Category", vbInformation, "MISSING CATEGORY"
Me.Parent!CodingID.SetFocus
End If
End If
End Sub
Many thanks for any help.
Bill