G
Guest
I'm using a form very similar to Northwind's Order form. When I try to select
the product on the subform I get "Compile error: Sub or Function not defined"
I'm not seeing where the problem could be. The function is from the
ProductIDcbo
as follows:
Private Sub ProductID_BeforeUpdate(Cancel As Integer)
' If Orders Subform is opened as a standalone form, display a message
' and undo changes made to the ProductName text box. (The IsLoaded function
' finds a form in the Forms collection when it's opened as a standalone
' form, but not when it's opened as a subform on a main form.)
Dim strMsg As String
Dim strTitle As String
Dim intStyle As Integer
If IsLoaded("Orders Subform") Then
strMsg = "You can't add or edit a Product Name when you open Orders
Subform as a standalone form."
intStyle = vbOKOnly
strTitle = "Can't Add or Change Product Name"
MsgBox strMsg, intStyle, strTitle
Me!ProductID.Undo
Me.Undo
End If
End Sub
Is this enough information? Am I asking the right question?
I need help with what I could be doing wrong here.
the product on the subform I get "Compile error: Sub or Function not defined"
I'm not seeing where the problem could be. The function is from the
ProductIDcbo
as follows:
Private Sub ProductID_BeforeUpdate(Cancel As Integer)
' If Orders Subform is opened as a standalone form, display a message
' and undo changes made to the ProductName text box. (The IsLoaded function
' finds a form in the Forms collection when it's opened as a standalone
' form, but not when it's opened as a subform on a main form.)
Dim strMsg As String
Dim strTitle As String
Dim intStyle As Integer
If IsLoaded("Orders Subform") Then
strMsg = "You can't add or edit a Product Name when you open Orders
Subform as a standalone form."
intStyle = vbOKOnly
strTitle = "Can't Add or Change Product Name"
MsgBox strMsg, intStyle, strTitle
Me!ProductID.Undo
Me.Undo
End If
End Sub
Is this enough information? Am I asking the right question?
I need help with what I could be doing wrong here.