I have also posted this question in Access World Forum you can Click here to see.
Hi, I need help,
I've created a voucher form to make different vouchers. There is a lookup field to select the Type of Voucher.
List of Voucher Types is:
- CP-Cash Payment
- CR-Cash Receipt
- BP-Bank Payment
- BR-Bank Receipt
- PB-Party Bill
- JO-Journal
- SL-Sales
A subform named GeneralLedger is associated with this main form.
Below are some of fields in the subform:
AccountCode, AccountID, InvoiceNo, ChequeNo, InvoiceDate etc.
I want to Hide ChequeNo field and Show InvoiceNo field if VoucherType in the main form is:
CP-Cash Payment, CR-Cash Receipt, PB-Party Bill, JO-Journal Or SL-Sales
And I want to Hide InvoiceNo and Show ChequeNo field if VoucherType in the main form is:
BP-Bank Payment Or BR-Bank Receipt
I've tried the following code:
But there is an error on End CaseCode:Private Sub VoucherType_Click() Dim SubFrm As Form Dim SelectType Set SubFrm = Me.GeneralLedger.Form SelectType = Me!VoucherType Select Case SelectType Case "CP-Cash-Payment" SubFrm.ChequeNo.Visible = False Case "CR-Cash Receipt" SubFrm.ChequeNo.Visible = False Case "PB-Party Bill" SubFrm.ChequeNo.Visible = False Case "JO-Journal " SubFrm.ChequeNo.Visible = False Case "SL-Sales" SubFrm.ChequeNo.Visible = False Case "BP-Bank Payment" SubFrm.ChequeNo.Visible = True Case "BR-Bank Receipt" SubFrm.ChequeNo.Visible = True End Case SubFrm.Refresh End Sub
Thank you in advance.