Hi All,
I have a form where a user reviews a request or declines it, they have a approve and decline button to choose from.
The results that are shown to them are from a query which breaks it up into requests that come under there control.
What I want is for when they click approve or decline for the form to refresh the query so basically it will get rid of the request that they just viewed.
Currently I have it coded so that when the approval is put through it just goes to the next record (which is not ideal) and comes to an error when it runs out of records to view as the form does not allow additions.
My code is posted below (keep in mind I haven't coded the delcine function yet)
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String, strTitle As String
strMsg = "Do You Want To Save This Record?"
strTitle = " Save Record ?"
If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then
Me.Undo
End If
End Sub
Private Sub ButApprove_Click()
On Error GoTo Err_ButApprove_Click
SuperApprove.Value = True
DoCmd.GoToRecord , , acNext
Exit_ButApprove_Click:
Exit Sub
Err_ButApprove_Click:
MsgBox Err.Description
Resume Exit_ButApprove_Click
End Sub
Can anyone help??
Cheers,
MB
I have a form where a user reviews a request or declines it, they have a approve and decline button to choose from.
The results that are shown to them are from a query which breaks it up into requests that come under there control.
What I want is for when they click approve or decline for the form to refresh the query so basically it will get rid of the request that they just viewed.
Currently I have it coded so that when the approval is put through it just goes to the next record (which is not ideal) and comes to an error when it runs out of records to view as the form does not allow additions.
My code is posted below (keep in mind I haven't coded the delcine function yet)
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String, strTitle As String
strMsg = "Do You Want To Save This Record?"
strTitle = " Save Record ?"
If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then
Me.Undo
End If
End Sub
Private Sub ButApprove_Click()
On Error GoTo Err_ButApprove_Click
SuperApprove.Value = True
DoCmd.GoToRecord , , acNext
Exit_ButApprove_Click:
Exit Sub
Err_ButApprove_Click:
MsgBox Err.Description
Resume Exit_ButApprove_Click
End Sub
Can anyone help??
Cheers,
MB