V
vircalendar via AccessMonster.com
I've been reading posts about this for hours, and trying all kinds of things
that people have suggested, but I can't seem to fix my problem.
I have a Form called frmHistory that includes a combo box cboAttending. The
combo box pulls from a table called tblAttending. The table has two columns:
a text field called txtattending (column one) and an autonumber key field.
There is no defined relationship other than "limit to list" being set to yes.
When someone tries to enter an unrecognized name into the combo box, the
notinlist event triggers the following code:
Private Sub cboAttending(NewData As String, Response As Integer)
Dim intResponse As Integer
Dim strMsg As String
strMsg = NewData & " is not a known Referring Attending. Add him or her?"
intResponse = MsgBox(strMsg, vbYesNo + vbQuestion, "Unknown Referrer")
Select Case intResponse
Case vbYes
DoCmd.OpenForm "frmNewDoc", acNormal, , , acFormAdd, acDialog
If IsLoaded("frmNewDoc") Then
Me![cboAttending] = Forms!frm_NewDoc![txtAttending]
DoCmd.Close acForm, "frmnewDoc"
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Case vbNo
Response = acDataErrContinue
End Select
End Sub
The code successfully adds the new name to both tblAttending and cboAttending,
but I still get the standard error message "The text you entered isn't an
item in the list." Any ideas about what I may be leaving out?
that people have suggested, but I can't seem to fix my problem.
I have a Form called frmHistory that includes a combo box cboAttending. The
combo box pulls from a table called tblAttending. The table has two columns:
a text field called txtattending (column one) and an autonumber key field.
There is no defined relationship other than "limit to list" being set to yes.
When someone tries to enter an unrecognized name into the combo box, the
notinlist event triggers the following code:
Private Sub cboAttending(NewData As String, Response As Integer)
Dim intResponse As Integer
Dim strMsg As String
strMsg = NewData & " is not a known Referring Attending. Add him or her?"
intResponse = MsgBox(strMsg, vbYesNo + vbQuestion, "Unknown Referrer")
Select Case intResponse
Case vbYes
DoCmd.OpenForm "frmNewDoc", acNormal, , , acFormAdd, acDialog
If IsLoaded("frmNewDoc") Then
Me![cboAttending] = Forms!frm_NewDoc![txtAttending]
DoCmd.Close acForm, "frmnewDoc"
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Case vbNo
Response = acDataErrContinue
End Select
End Sub
The code successfully adds the new name to both tblAttending and cboAttending,
but I still get the standard error message "The text you entered isn't an
item in the list." Any ideas about what I may be leaving out?