Combobox not on list error

Jon123

Registered User.
Local time
Today, 18:33
Joined
Aug 29, 2003
Messages
668
so I have a form that has a combo box that a user selects from. If the value
they are trying to enter is not on the list them I have a Yes / No msg box open asking them if they want to add this value to the list. That part works but I'm getting an Access error saying value not on list please select a value for the list. how do I turn this error off I tried DoCmd. setwarnings False but that does not do it.

any help

jon
 
I still get the Access error telling me the the value is not in the list.

????
 
This is the code. But the error that I'm getting I believe its built in access


Dim StdResponse As Integer
DoCmd.SetWarnings False
StdResponse = MsgBox("This Part Number is NOT recorded in the Finger Print. Would you like to add this Part Number?", 52)
If StdResponse = 6 Then 'Yes
DoCmd.OpenForm "Frm-Adding New Parts"
Else
Exit Sub
End If
End Sub
 
This is the code. But the error that I'm getting I believe its built in access


Dim StdResponse As Integer
DoCmd.SetWarnings False
StdResponse = MsgBox("This Part Number is NOT recorded in the Finger Print. Would you like to add this Part Number?", 52)
If StdResponse = 6 Then 'Yes
DoCmd.OpenForm "Frm-Adding New Parts"
Else
Exit Sub
End If
End Sub

That is nothing like what I gave you with that link. But,

1. You need to open your form to add the new part as a DIALOG so
DoCmd.OpenForm "Frm-Adding New Parts", acNormal, ,acNormal,,,acFormAdd,acDialog

2. And then the other part where you have to put in the
Response = acDataErrAdded

So, your code should look like:
Code:
   Dim StdResponse As Integer
     DoCmd.SetWarnings False
     StdResponse = MsgBox("This Part Number is NOT recorded in the Finger Print. Would you like to add this Part Number?", 52)
     If StdResponse = 6 Then 'Yes
     DoCmd.OpenForm "Frm-Adding New Parts", acNormal, ,acNormal,,,acFormAdd,acDialog
        Response = acDataErrAdded
   Else
        Response = acDataErrContinue
   End If
End Sub
 
I tried this code and it still returns an Access Error box stating value not in list. I can make this work but I would like to get rid of that error.
 
I tried this code and it still returns an Access Error box stating value not in list. I can make this work but I would like to get rid of that error.

You shouldn't get that error if you put the code I gave you on the Not In List event of the combo box. If you still do, then post the database because I would sure like to see why it is still happening.
 
I am having a problem with the following line

DoCmd.OpenForm "Frm-Adding New Parts", acNormal, ,acNormal,,,acFormAdd,acDialog

it does not like the acDialog I get a compiler error wrong number of arguments
Jon
 
Somehow I got some extra stuff in there. It should be:

DoCmd.OpenForm "Frm-Adding New Parts", acNormal, ,,acFormAdd,acDialog
 
Thats the ticket it looks to be work well in the test dbase I was just putting together to send to you. I will put it into the real database and let you know how it goes.

thanks for all the help

jon
 
Thats the ticket it looks to be work well in the test dbase I was just putting together to send to you. I will put it into the real database and let you know how it goes.

thanks for all the help

jon

Whew! Glad to hear.
 

Users who are viewing this thread

Back
Top Bottom