R
richaluft
Hi;
Second time I'm asking this question, and hope someone can suggest a
cure.
I'm running a form with a cbo box for data entry. I have 5 other
BASICALLY IDENTICAL cbo's on the form, all of which work fine.
My NotOnList event is as follows:
' Add a new policy type by typing a name in
' CoPolicy Type combo box.
Dim NewCoPolicyType As Integer, TruncateName As Integer, Title As
String, MsgDialog As Integer
Const MB_OK = 0
Const MB_YESNO = 4
Const MB_ICONQUESTIONMARK = 32
Const MB_ICONEXCLAMATION = 64
Const MB_DEFBUTTON1 = 0, IDYES = 6, IDNO = 7
' Display message box asking if user wants to add a
' new insurer.
Title = "Policy Type Not In List"
MsgDialog = MB_YESNO + MB_ICONQUESTIONMARK + MB_DEFBUTTON1
NewCoPolicyType = MsgBox("Do you want to add a new Policy Type?",
MsgDialog, Title)
If NewCoPolicyType = IDYES Then
' Open Add Policy form.
DoCmd.OpenForm FormName:="FPolicyTypeCo", DataMode:=acAdd,
WindowMode:=acDialog, openargs:=NewData
' Continue without displaying default error message.
Response = acDataErrAdded
End If
End Sub
When THIS PARTICULAR NotInList event fires, I am find that:
1)the cbo is not cleared of the newdata entry as the dialogue form
opens (as it does on all my other cbo's). Note, however, that the
openargs ARE properly carried to the dialogue form.
2)When the dialogue form is closed, my cbo is blank, and I get errmsg
of "item not in list".
Can anyone make any sense of why this is happening on only one of six
cbos, and any solution you can recommend.
TIA, Richard
Second time I'm asking this question, and hope someone can suggest a
cure.
I'm running a form with a cbo box for data entry. I have 5 other
BASICALLY IDENTICAL cbo's on the form, all of which work fine.
My NotOnList event is as follows:
' Add a new policy type by typing a name in
' CoPolicy Type combo box.
Dim NewCoPolicyType As Integer, TruncateName As Integer, Title As
String, MsgDialog As Integer
Const MB_OK = 0
Const MB_YESNO = 4
Const MB_ICONQUESTIONMARK = 32
Const MB_ICONEXCLAMATION = 64
Const MB_DEFBUTTON1 = 0, IDYES = 6, IDNO = 7
' Display message box asking if user wants to add a
' new insurer.
Title = "Policy Type Not In List"
MsgDialog = MB_YESNO + MB_ICONQUESTIONMARK + MB_DEFBUTTON1
NewCoPolicyType = MsgBox("Do you want to add a new Policy Type?",
MsgDialog, Title)
If NewCoPolicyType = IDYES Then
' Open Add Policy form.
DoCmd.OpenForm FormName:="FPolicyTypeCo", DataMode:=acAdd,
WindowMode:=acDialog, openargs:=NewData
' Continue without displaying default error message.
Response = acDataErrAdded
End If
End Sub
When THIS PARTICULAR NotInList event fires, I am find that:
1)the cbo is not cleared of the newdata entry as the dialogue form
opens (as it does on all my other cbo's). Note, however, that the
openargs ARE properly carried to the dialogue form.
2)When the dialogue form is closed, my cbo is blank, and I get errmsg
of "item not in list".
Can anyone make any sense of why this is happening on only one of six
cbos, and any solution you can recommend.
TIA, Richard