DblDogDare
Registered User.
- Local time
- Today, 14:18
- Joined
- Feb 14, 2003
- Messages
- 17
I am getting a runtime error 438 on a requery that I can't figure out what I am doing wrong. I have a form with a combo box that I have the users entering a project name in the combo box. If the project name does not exist, I have another pop up (onLoad) form for them to enter the new project data. This subform has a save and close form button. When I close this form, I get the run time error. When I debug, it indicates the error is at the requery line. If I check the table where the combo box gets its data, the new entry is there.
I followed a previous post that I searched on from Mile-O-Phile. It was very helpful thus far. Here is my code behind what I am trying to accomplish.
Private Sub Project_Title_NotInList(NewData As String, Response As Integer)
Response = MsgBox(Me.[ProjectName] & " is not recognized in this database." & vbCrLf & vbCrLf & "Would you like to add it?", vbQuestion + vbYesNo, "Unrecognized Data")
If Response = vbYes Then
DoCmd.OpenForm "frmAddProject", acNormal, , , acFormAdd, acDialog, NewData
Me.[ProjectName].Requery
Response = acDataErrAdded
Else
Me.[ProjectName].Undo
Response = acDataErrContinue
End If
End Sub
It may also help to know, the combo box table is tblProject. my combo box control Source is ProjectName, so the field name and the combo box name are ProjectName. Could this naming be causing the problem. BTW, I am using Access 2000.
Any help is greatly appreciated.
I followed a previous post that I searched on from Mile-O-Phile. It was very helpful thus far. Here is my code behind what I am trying to accomplish.
Private Sub Project_Title_NotInList(NewData As String, Response As Integer)
Response = MsgBox(Me.[ProjectName] & " is not recognized in this database." & vbCrLf & vbCrLf & "Would you like to add it?", vbQuestion + vbYesNo, "Unrecognized Data")
If Response = vbYes Then
DoCmd.OpenForm "frmAddProject", acNormal, , , acFormAdd, acDialog, NewData
Me.[ProjectName].Requery
Response = acDataErrAdded
Else
Me.[ProjectName].Undo
Response = acDataErrContinue
End If
End Sub
It may also help to know, the combo box table is tblProject. my combo box control Source is ProjectName, so the field name and the combo box name are ProjectName. Could this naming be causing the problem. BTW, I am using Access 2000.
Any help is greatly appreciated.