Hi, I've got a form that allows a user to imput their flight data. I programmed a MsgBox into the save button that asks if the user wants to input another duty position for the flight.
If no, the record saves and the formresets for the next rocord input.
If yes, the record is saved and the duty position and mode of flight fields are set to null, with the remainder of the fields retaining the data already entered.
The problem is that when I press save again, the message box appears, and when I press yes or no I get the 'Save Record' not available error message.
Code attached. Any ideas?
[CODE=vb]Private Sub Command38_Click ()
On Error GoTo Err_Command38_C lick
Response = MsgBox("Add another duty position?", 4)
If Response = 7 Then
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecor d , , acNewRec
Else
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[PI] = Null
[PC] = Null
[IP] = Null
[SP] = Null
[IE] = Null
[MTP] = Null
[Daytime] = Null
[Night] = Null
[NVG] = Null
[Hood] = Null
End If
Exit_Command38_ Click:
Exit Sub
Err_Command38_C lick:
MsgBox Err.Description
Resume Exit_Command38_ Click
End Sub[/CODE]
If no, the record saves and the formresets for the next rocord input.
If yes, the record is saved and the duty position and mode of flight fields are set to null, with the remainder of the fields retaining the data already entered.
The problem is that when I press save again, the message box appears, and when I press yes or no I get the 'Save Record' not available error message.
Code attached. Any ideas?
[CODE=vb]Private Sub Command38_Click ()
On Error GoTo Err_Command38_C lick
Response = MsgBox("Add another duty position?", 4)
If Response = 7 Then
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecor d , , acNewRec
Else
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[PI] = Null
[PC] = Null
[IP] = Null
[SP] = Null
[IE] = Null
[MTP] = Null
[Daytime] = Null
[Night] = Null
[NVG] = Null
[Hood] = Null
End If
Exit_Command38_ Click:
Exit Sub
Err_Command38_C lick:
MsgBox Err.Description
Resume Exit_Command38_ Click
End Sub[/CODE]
Comment