need help with Notinlist code

Jon123

Registered User.
Local time
Yesterday, 23:55
Joined
Aug 29, 2003
Messages
668
This is the code

Code:
Private Sub Combo7_NotInList(NewData As String, Response As Integer)
     On Error GoTo Err_Readme_Click
     Dim StdResponse As Integer
     DoCmd.SetWarnings False
     StdResponse = MsgBox("This Customer is NOT recorded in the program. Would you like to add this Customer?", 52)
     If StdResponse = 6 Then 'Yes
     Me.Undo
     DoCmd.close acForm, "Selectcustomer"
     DoCmd.OpenForm "addingcustomer", acNormal, , , acFormAdd, acDialog
        Response = acDataErrContinue
   Else
        Response = acDataErrContinue
   End If
Exit_Readme_Click:
    Exit Sub
Err_Readme_Click:
   Exit Sub
   Resume Exit_Readme_Click
End Sub
[code/]


when this code runs I get the msgbox over and over again 

why


jon
 
This is the code

Code:
Private Sub Combo7_NotInList(NewData As String, Response As Integer)
     On Error GoTo Err_Readme_Click
     Dim StdResponse As Integer
     DoCmd.SetWarnings False
     StdResponse = MsgBox("This Customer is NOT recorded in the program. Would you like to add this Customer?", 52)
     If StdResponse = 6 Then 'Yes
     Me.Undo
     DoCmd.close acForm, "Selectcustomer"
     DoCmd.OpenForm "addingcustomer", acNormal, , , acFormAdd, acDialog
        Response = acDataErrContinue
   Else
        Response = acDataErrContinue
   End If
Exit_Readme_Click:
    Exit Sub
Err_Readme_Click:
   Exit Sub
   Resume Exit_Readme_Click
End Sub
[code/]


when this code runs I get the msgbox over and over again 

why


jon[/QUOTE]
A few comments on the above:

The LimitToList property must be set to Yes for this to work.  Have you done that.

[quote]      Response = acDataErrContinue
   Else
        Response = acDataErrContinue[/quote]
Why do you need the "Else" and the "Response" line after that.

[quote]Err_Readme_Click:
   Exit Sub
   Resume Exit_Readme_Click[/quote]

If you "Exit Sub" it can't get to the "Resume" line.
 

Users who are viewing this thread

Back
Top Bottom