If VB Yes, make label visble, How?

D

Dave Elliott

How can i make my label visible if the user answers yes to the print?
The label is named Label470
default is set to label470 visible is no

If vbYes = MsgBox("Do you want to print the customer's receipt?", vbQuestion
+ vbYesNo, "Print Receipt?") Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

If (IsNull(Payment) = False) And (Balance) = 0 Then
DoCmd.OpenReport "InvoiceReport", acNormal, "",
"[TimeID]=[Forms]![TimeCards]![TimeID]"
End If

If [Forms]![TimeCards]![BidDiscAmt] < DSum("Payment", "TPaymentSub",
"TimeID = [Forms]![TimeCards]!TimeID") Then
Reports!InvoiceReport!QuoteInvLabel.Caption = "Credit Invoice"
Else
Reports!InvoiceReport!QuoteInvLabel.Caption = "Invoice"
End If

End If
 
K

Klatuu

See Below

Dave Elliott said:
How can i make my label visible if the user answers yes to the print?
The label is named Label470
default is set to label470 visible is no

If vbYes = MsgBox("Do you want to print the customer's receipt?", vbQuestion
+ vbYesNo, "Print Receipt?") Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

If (IsNull(Payment) = False) And (Balance) = 0 Then
DoCmd.OpenReport "InvoiceReport", acNormal, "",
"[TimeID]=[Forms]![TimeCards]![TimeID]"
End If

If [Forms]![TimeCards]![BidDiscAmt] < DSum("Payment", "TPaymentSub",
"TimeID = [Forms]![TimeCards]!TimeID") Then
Reports!InvoiceReport!QuoteInvLabel.Caption = "Credit Invoice"
Reports!InvoiceReport!QuoteInvLabel.Visible = True
Else
Reports!InvoiceReport!QuoteInvLabel.Caption = "Invoice"
Reports!InvoiceReport!QuoteInvLabel.Visible = True
 
K

Klatuu

When you close the form, set the save argument in the DoCmd.Close argument to
acSaveYes. That will save your form with the changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top