R
reservedbcreater
i have a button called next, which goes to the next form of the suvey
when clicked i want it to trigger this event:
(what code do i put int the next button(which currently has no code) click
event to trigger it)
Private Sub Form_BeforeUpdate(Cancel As Integer)
dim intResponse2 as integer
Dim strDocName As String
Dim intResponse As Integer
Dim strID As String
strDocName = "Water"
intResponse = MsgBox("Save Record?", vbYesNoCancel)
Select Case intResponse
Case vbYes
intResponse2 = MsgBox("Go to next page", vbYesNo)
Select Case intResponse2
Case vbYes
strID = Me.ID
DoCmd.Close
DoCmd.OpenForm strDocName
Forms(strDocName)!ID = strID
End Select
Case vbNo
Me.Undo 'To undo the edit
Case vbCancel
Cancel = True 'To cancel the update & hence the close
End Select
End Sub
when clicked i want it to trigger this event:
(what code do i put int the next button(which currently has no code) click
event to trigger it)
Private Sub Form_BeforeUpdate(Cancel As Integer)
dim intResponse2 as integer
Dim strDocName As String
Dim intResponse As Integer
Dim strID As String
strDocName = "Water"
intResponse = MsgBox("Save Record?", vbYesNoCancel)
Select Case intResponse
Case vbYes
intResponse2 = MsgBox("Go to next page", vbYesNo)
Select Case intResponse2
Case vbYes
strID = Me.ID
DoCmd.Close
DoCmd.OpenForm strDocName
Forms(strDocName)!ID = strID
End Select
Case vbNo
Me.Undo 'To undo the edit
Case vbCancel
Cancel = True 'To cancel the update & hence the close
End Select
End Sub