Zeroanarchy
Technical User
Hi All, thanks for taking time to have a look at this for me.
I am getting an error on the following line:
DoCmd.GoToRecord , , acNewRec
I also tried bring the two lines together:
FROM
DoCmd.GoToRecord , , acNewRec
Me.crewno.Value = NewData
TO
DoCmd.GoToRecord , , NewData
But I still get the same error can anyone tell me where I am going wrong??
Cheers,
CODE:
---------------------------------------------------------
Private Sub crewno_NotInList(NewData As String, Response As Integer)
Dim intReply As Integer
Dim strSQL As String
intReply = MsgBox("Crew No?" & _
vbCrLf & vbCrLf & _
NewData & " is not currently in the list of crew numbers" & _
vbCrLf & vbCrLf & _
"Do you wish to add a new crew to the list now?", _
vbQuestion + vbYesNo + vbDefaultButton2, _
"Add to list"
If intReply = vbYes Then
Me.crewsubform.Visible = False
DoCmd.GoToRecord , , acNewRec
Me.crewno.Value = NewData
Response = acDataErrAdded
Else
Me("crewno"
.Undo
Me("crewno"
.Dropdown
Response = acDataErrContinue
End If
End Sub
ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.
I am getting an error on the following line:
DoCmd.GoToRecord , , acNewRec
I also tried bring the two lines together:
FROM
DoCmd.GoToRecord , , acNewRec
Me.crewno.Value = NewData
TO
DoCmd.GoToRecord , , NewData
But I still get the same error can anyone tell me where I am going wrong??
Cheers,
CODE:
---------------------------------------------------------
Private Sub crewno_NotInList(NewData As String, Response As Integer)
Dim intReply As Integer
Dim strSQL As String
intReply = MsgBox("Crew No?" & _
vbCrLf & vbCrLf & _
NewData & " is not currently in the list of crew numbers" & _
vbCrLf & vbCrLf & _
"Do you wish to add a new crew to the list now?", _
vbQuestion + vbYesNo + vbDefaultButton2, _
"Add to list"
If intReply = vbYes Then
Me.crewsubform.Visible = False
DoCmd.GoToRecord , , acNewRec
Me.crewno.Value = NewData
Response = acDataErrAdded
Else
Me("crewno"
Me("crewno"
Response = acDataErrContinue
End If
End Sub
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.