maxmangion
AWF VIP
- Local time
- Today, 22:57
- Joined
- Feb 26, 2003
- Messages
- 2,805
i have a form frmSongs and it has a field (cboSinger). when a value is inputted which is notinlist, the following code executes. the code works fine, except for the part of the openargs in the docmd.openform. Can someone guide me what i have wrong in this pls:
Thank you!
Code:
Private Sub cboSinger_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_cboSinger_NotInList
If MsgBox(NewData & " is not in List" & vbCrLf & "Would you like to Add it to the List", vbQuestion + vbYesNo, "Warning ...") = vbYes Then
DoCmd.OpenForm "frmSingers", , , , acFormAdd, acDialog, OpenArgs:="[Singer] = '" & Me.Singer.Value & "'"
Response = acDataErrAdded
Else
Me.cboSinger.Undo
Me.cboft.SetFocus
Response = acDataErrContinue
End If
Exit_Err_cboSinger_NotInList:
Exit Sub
Err_cboSinger_NotInList:
MsgBox Err.Description & Err.Number, vbExclamation, "Warning ..."
Resume Exit_Err_cboSinger_NotInList
End Sub
Thank you!