Hello,
I have a form with a list box. I want to use the not in list property to allow entry of new items.
I have coded the not in list as follows
Private Sub CategoryID_NotInList(NewData As String, Response As Integer)
If MsgBox("Category Not Found, Add?", vbYesNo + vbQuestion, _
"Please Respond" = vbYes Then
DoCmd.OpenForm "frmcategories", _
Datamode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=NewData
If IsLoaded("frmcatagories" Then
Response = acDataErrAdded
DoCmd.Close acForm, "frmcategories"
Else
Response = acDataErrContinue
End If
Else
Response = acDataErrContinue
End If
End Sub
I have also coded my pop up form as follows
Private Sub cmdcancel_Click()
DoCmd.RunCommand acCmdUndo
DoCmd.Close
End Sub
Private Sub cmdOk_Click()
me.visible = false
End Sub
Private Sub Form_Load()
Me.Category.Value = Me.OpenArgs
End Sub
Everything is working until it trys to run 2nd half of the code in the Not in List property. I keep geting a compile error on the IsLoaded property.
Am I missing something??
I have a form with a list box. I want to use the not in list property to allow entry of new items.
I have coded the not in list as follows
Private Sub CategoryID_NotInList(NewData As String, Response As Integer)
If MsgBox("Category Not Found, Add?", vbYesNo + vbQuestion, _
"Please Respond" = vbYes Then
DoCmd.OpenForm "frmcategories", _
Datamode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=NewData
If IsLoaded("frmcatagories" Then
Response = acDataErrAdded
DoCmd.Close acForm, "frmcategories"
Else
Response = acDataErrContinue
End If
Else
Response = acDataErrContinue
End If
End Sub
I have also coded my pop up form as follows
Private Sub cmdcancel_Click()
DoCmd.RunCommand acCmdUndo
DoCmd.Close
End Sub
Private Sub cmdOk_Click()
me.visible = false
End Sub
Private Sub Form_Load()
Me.Category.Value = Me.OpenArgs
End Sub
Everything is working until it trys to run 2nd half of the code in the Not in List property. I keep geting a compile error on the IsLoaded property.
Am I missing something??