Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Help With Access


(!)

WynandGreyling's Avatar
WynandGreyling WynandGreyling is offline
Member with 2 posts.
THREAD STARTER
 
Join Date: Jul 2012
Experience: Beginner
30-Jul-2012, 02:18 AM #1
Help With Access
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
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,610 posts.
 
Join Date: Mar 2005
Location: UK
30-Jul-2012, 02:49 PM #2
WynandGreyling, welcome to the Forum.
This will require some VBA code to set the form's filter, you can see how it is done by this Allen Browne database which I posted on this thread, post #10.
http://forums.techguy.org/business-a...ss-search.html
WynandGreyling's Avatar
WynandGreyling WynandGreyling is offline
Member with 2 posts.
THREAD STARTER
 
Join Date: Jul 2012
Experience: Beginner
31-Jul-2012, 06:53 AM #3
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
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,610 posts.
 
Join Date: Mar 2005
Location: UK
31-Jul-2012, 11:18 AM #4
You should not use VBA code, you should use the Forms Master/Child Links.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑