Hi All,
I have been using the same code to add a new item to a combobox list for over 7 years. Now i am getting a weird result, the form goes to a new record (every field is blank). You can use scroll on mouse and go back to the original record. (I have compiled my code)
I searched and found a few good changes to try, one Remou's and one theAceman1. But i have the form based on input from the user ( user inputs the sales order number) and when i try either of the suggestions, the user would have to input the sales order # again.
I have a lot of code behind this form, it is the first messaging database i have made, so maybe it is flaking out because of other code i have within the form. Has anyone ran into this problem before?
Here is the code:
It is short and sweet and i am certain i got this code orginally from this forum years ago. This code is working in 4 other forms in this database just fine.
Any help would be appreciated.
Raven
I have been using the same code to add a new item to a combobox list for over 7 years. Now i am getting a weird result, the form goes to a new record (every field is blank). You can use scroll on mouse and go back to the original record. (I have compiled my code)
I searched and found a few good changes to try, one Remou's and one theAceman1. But i have the form based on input from the user ( user inputs the sales order number) and when i try either of the suggestions, the user would have to input the sales order # again.
I have a lot of code behind this form, it is the first messaging database i have made, so maybe it is flaking out because of other code i have within the form. Has anyone ran into this problem before?
Here is the code:
Code:
Dim db As DAO.Database
If MsgBox("SALESMAN'S NAME IS NOT IN THE LIST. WOULD YOU LIKE TO ADD IT?", vbYesNo, "UNKNOWN SALESMAN NAME") = vbYes Then
Set db = CurrentDb()
db.Execute "Insert into tblsman ([salesmanname]) values ('" & NewData & "');"
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Set db = Nothing
It is short and sweet and i am certain i got this code orginally from this forum years ago. This code is working in 4 other forms in this database just fine.
Any help would be appreciated.
Raven