TryingToLearn
Well-known Member
- Joined
- Sep 10, 2003
- Messages
- 730
With the cash register in mind, I have a userform to enter different tickets and donations sold for our Relay for Life. After the total due is shown the appropriate tender key is clicked. This in turn brings up another userform to collect info for the tender selected (Cash, Checks, Credit). Problem is if the user pressed the wrong tender (ie. Cash instead of Check) I can't figure out how to tell the calling sub to abort and not record the transaction. Of course the event is tomorrow... TIA
sub in userform Entries:
Above code calls userform below:
If user wants to cancel the "Tendered" form then this would be the Userform "CshTndr" section to cancel.
So what could I do in this second snippit to pass back to the first sub?
sub in userform Entries:
VBA Code:
Private Sub CB5_Click() 'CASH
Dim WS As Worksheet
'HANDLE CASH TENDERED
CshTndr.TB1 = Me.TB0
CshTndr.Show
'=============================
'HOW TO ABORT SUB IF CANCELED FROM
'TENDERED USERFORM
'=============================
'GO TO SHEET ENTRIES AND RECORD TRANSACTION
Set WS = Sheets("entries")
WS.Select 'TAKE OUT AFTER PROOFING
' COLLECT COUNT OF TYPE OF SALES & TRANSACTIONS
With Sheets("entries")
...code continues
Above code calls userform below:
If user wants to cancel the "Tendered" form then this would be the Userform "CshTndr" section to cancel.
VBA Code:
Private Sub CB1_Click()
Rsp = MsgBox("Are you sure you want to cancel this transaction?", vbYesNo)
If Rsp = vbYes Then
Unload me
'AND ADD SOMETHING TO CANCEL CALLING SUB FROM CONTINUING
End If
End Sub
So what could I do in this second snippit to pass back to the first sub?