1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help With Access

Discussion in 'Business Applications' started by WynandGreyling, Jul 30, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. WynandGreyling

    WynandGreyling Thread Starter

    Joined:
    Jul 29, 2012
    Messages:
    2
    Good morning From my side of the world I am new to your site but not so new to Access learned allot in the last few months
    but I've finally hit a wall so I'll try be clear and hope i understand the help..

    Ok here it goes....

    I have a From (LoadInvoices) with a Subform in datasheetview (WaybillToInvoice) then on the main form i have a combobox Where you can select Account Number

    Now What I'm trying to do is Set up a button with VBA so that on the click event it filters the subform on two fields

    [AccountNumber] is a text field And [Invoiced] is a chekboxfield yes\no

    Thank you In Advance for the help
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
  3. WynandGreyling

    WynandGreyling Thread Starter

    Joined:
    Jul 29, 2012
    Messages:
    2
    Hi OBP thank you for the reply how ever I solved it using the following VBA Code

    If Me.[InvoiceSubform].Form.FilterOn = True Then
    Me.[InvoiceSubform].Form.Filter = ""
    Me.[InvoiceSubform].Form.FilterOn = False
    Me!btn.Caption = "Apply Filter"
    Else:
    Me.[InvoiceSubform].Form.Filter = "[Paid]=No"
    Me.[InvoiceSubform].Form.FilterOn = True
    Me!btn.Caption = "Remove Filter"
    End If

    And didn't get a Chance to Post till now. I am learning from scratch but learning fast My Project is working In amazing ways and really helping to speed up my Work so no im more productive. Learned allot From googling in the beginning and youtube videos

    Then i Have one more Question For now I need a Button to Fill in values (InvoiceNumber) In my subforms Rocords which is Filtered By Account Number, So far i Have this code

    Private Sub load_Click()
    Me!LoadWaybillsSubform!InvoiceNumber = Me.InvoiceNumber
    End Sub

    But the problem is that it only fills one Record then you have to click on the next record and click the button again. I tryed to use the docmd gotorecord code and made a loop but that goes through all the records and only the filtered ones like I need It to do. Would that be possible
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    You should not use VBA code, you should use the Forms Master/Child Links.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1063122