I have a form .. which user enters in data.. then they click the add button msgbox comes up and ask if user was the save..
user clicks yes..
then andother msgbox pops up ... stating info as been added.. User clicks ok..
another message box pops up asking if the user wants to add another record ...
If the user clicks yes.. msgbox comes up telling the user what record they are on... ( doing this because user needs to enter in the record number.. for another part of the app )
my question is..
when the user clicks ok to the last msgbox.. (the one where it tells him/her which record is next) its puts them back on the original form with the orginal data.. i want to blank out the form.. so user can enter in new data w/o having to see old data.... how would i do this...
here is some of my code...
Select Case MsgBox("Do you want to save your changes to the current record?" & vbCrLf & vbLf & " Yes: Saves Changes" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & " Cancel: Reset (Undo) Changes" & vbCrLf, vbYesNoCancel + vbQuestion, "Save Current Record"
Case vbYes: 'Save the changes
Set RS = CurrentDb.OpenRecordset("tblOpen", dbOpenTable)
With RS
.AddNew
!AuditItem = AuditItem.Value
!Leader = Leader.Value
!Members = Members.Value
!Location = Location.Value
!Shift = Shift.Value
!AdateOpen = AdateOpen.Value
!Responsibility = Responsibility.Value
!AuditFocus = AuditFocus.Value
!AuditItemIdentified = AuditItemIdentified.Value
!Timing = Timing.Value
!OpenorClose = OpenorClose.Value
.Update
.Close
End With
AuditItem.SetFocus
AuditNo = AuditItem.Text
AdateOpen.SetFocus
OpenDate = AdateOpen.Text
Leader.SetFocus
Leading = Leader.Text
strsql = "INSERT INTO tblClose (AuditItem, AdateOpen, Leader) VALUES ('" & AuditNo & "', #" & OpenDate & "#, '" & Leading & "');"
DoCmd.RunSQL strsql
MsgBox "Audit Item: " & AuditNo & vbCrLf & "Open Date: " & OpenDate & vbCrLf & "Leader: " & Leading & vbCrLf & vbCrLf & "Has Been Updated!", vbInformation, "Updating Audit"
Select Case MsgBox("Would you like to add another audit?" & vbCrLf & vbLf & " Yes: Add New Audit" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & vbCrLf, vbYesNo + vbQuestion, "Add Another Audit?"
Case vbYes: 'Save the changes
Dim db As DAO.Database
Dim tdef As DAO.TableDef
Set db = CurrentDb()
Set tdef = db.TableDefs("tblOpen"
MsgBox "Begin next audit with Audit No: " & tdef.RecordCount + 1
DoCmd.OpenForm "frmOpenAudit"
DoCmd.GoToRecord , , acNewRec
Case vbNo: 'Do not save or undo
'Do nothing
End Select
thanks
user clicks yes..
then andother msgbox pops up ... stating info as been added.. User clicks ok..
another message box pops up asking if the user wants to add another record ...
If the user clicks yes.. msgbox comes up telling the user what record they are on... ( doing this because user needs to enter in the record number.. for another part of the app )
my question is..
when the user clicks ok to the last msgbox.. (the one where it tells him/her which record is next) its puts them back on the original form with the orginal data.. i want to blank out the form.. so user can enter in new data w/o having to see old data.... how would i do this...
here is some of my code...
Select Case MsgBox("Do you want to save your changes to the current record?" & vbCrLf & vbLf & " Yes: Saves Changes" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & " Cancel: Reset (Undo) Changes" & vbCrLf, vbYesNoCancel + vbQuestion, "Save Current Record"
Case vbYes: 'Save the changes
Set RS = CurrentDb.OpenRecordset("tblOpen", dbOpenTable)
With RS
.AddNew
!AuditItem = AuditItem.Value
!Leader = Leader.Value
!Members = Members.Value
!Location = Location.Value
!Shift = Shift.Value
!AdateOpen = AdateOpen.Value
!Responsibility = Responsibility.Value
!AuditFocus = AuditFocus.Value
!AuditItemIdentified = AuditItemIdentified.Value
!Timing = Timing.Value
!OpenorClose = OpenorClose.Value
.Update
.Close
End With
AuditItem.SetFocus
AuditNo = AuditItem.Text
AdateOpen.SetFocus
OpenDate = AdateOpen.Text
Leader.SetFocus
Leading = Leader.Text
strsql = "INSERT INTO tblClose (AuditItem, AdateOpen, Leader) VALUES ('" & AuditNo & "', #" & OpenDate & "#, '" & Leading & "');"
DoCmd.RunSQL strsql
MsgBox "Audit Item: " & AuditNo & vbCrLf & "Open Date: " & OpenDate & vbCrLf & "Leader: " & Leading & vbCrLf & vbCrLf & "Has Been Updated!", vbInformation, "Updating Audit"
Select Case MsgBox("Would you like to add another audit?" & vbCrLf & vbLf & " Yes: Add New Audit" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & vbCrLf, vbYesNo + vbQuestion, "Add Another Audit?"
Case vbYes: 'Save the changes
Dim db As DAO.Database
Dim tdef As DAO.TableDef
Set db = CurrentDb()
Set tdef = db.TableDefs("tblOpen"
MsgBox "Begin next audit with Audit No: " & tdef.RecordCount + 1
DoCmd.OpenForm "frmOpenAudit"
DoCmd.GoToRecord , , acNewRec
Case vbNo: 'Do not save or undo
'Do nothing
End Select
thanks