doran_doran
Registered User.
- Local time
- Yesterday, 20:29
- Joined
- Aug 15, 2002
- Messages
- 349
Ok, I have following. I have a form called "frmGroups" and there is a button called "cmdOpenInvoice". There is field in the frmGroups called cmdBillingStructure. If this field populated with "Group Not Billed" and if someone tries to click on Invoice I would like to pop a msg "are you sure you want to create an invoice", if end user click no it should come back to the same record in frmGroups. Now, if the field populated with "group billed" then there should be no msg and it should open "frmOrderbyCustomer"
Regards / Dianna Jamil Goldburg
Here is my code
=========================================================
Private Sub cmdOpenInvoice_Click()
On Error GoTo Err_OpenInvoice_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Const Message7 = "This group is set to Group Not Billed, Are you Sure you want to create an Invoice."
If Me.cboBillingStructure.Value = "Group Not Billed" And MsgBox(Message7, vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenForm "frmOrdersByCustomer", , , "[GA_Record_ID_2]='" & [GA_Record_ID_2] & "'"
Else
Me.Visible = True
End If
Me.Visible = False
Exit_OpenInvoice_Click:
Exit Sub
Err_OpenInvoice_Click:
MsgBox Err.Description
Resume Exit_OpenInvoice_Click
End Sub
==========================================================
Regards / Dianna Jamil Goldburg
Here is my code
=========================================================
Private Sub cmdOpenInvoice_Click()
On Error GoTo Err_OpenInvoice_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Const Message7 = "This group is set to Group Not Billed, Are you Sure you want to create an Invoice."
If Me.cboBillingStructure.Value = "Group Not Billed" And MsgBox(Message7, vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenForm "frmOrdersByCustomer", , , "[GA_Record_ID_2]='" & [GA_Record_ID_2] & "'"
Else
Me.Visible = True
End If
Me.Visible = False
Exit_OpenInvoice_Click:
Exit Sub
Err_OpenInvoice_Click:
MsgBox Err.Description
Resume Exit_OpenInvoice_Click
End Sub
==========================================================