Results 1 to 13 of 13
  1. #1
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126

    Filter form to only show true\false records

    Hi

    I need some guidelines or the theory on how to show all the records that haven been paid for. I have a form with 2 subforms, on the first subform the is a tickbox that shows if a order is paid for of not, the second subform shows the details of the order.

    I was thinking to have 2 option buttons saying show paid orders and show un-paid orders on the form. or is there a better way?? what is the theory behide this??
    the attach below shows the form where the paid check box is and the 2 options buttons (are or will go)



    Click image for larger version. 

Name:	1.png 
Views:	18 
Size:	34.8 KB 
ID:	11112

    Thanks

  2. #2
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    yes.. if that is your method of choice.. I would do it with a combo box.

    choices .. all,paid, unpaid
    default= 0
    three fields tied to field 1
    0;ALL;FALSE
    1;PAID;TRUE
    2;UNPAID;False

    field widths 0;2;0
    column counts 3

    on events of the combo box .. after update

    you can set the filter of the main form or you can change the record source it's up to you
    I usually change the record source
    if me.comboboxname <> 0 then
    me.RecordSource = "select * from yourtable where checkfieldname = " & me.comboboxname.column(2)
    else
    me.RecordSource = "select * from yourtable "
    end if
    me.requery

  3. #3
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126
    Hi
    I have added a new combox box and typed the values in the wizard (All, Paid & Un-Paid)

    Hm where do i put these 3 lines of code:
    0;ALL;FALSE
    1;PAID;TRUE
    2;UNPAID;False

    After putting the code in shown below, (after update event)
    the debug is saying there is something wrong in the middle line? (Bold, underlined below)

    Private Sub ComboPaymentFilter_AfterUpdate()
    If Me.ComboPaymentFilter <> 0 Then
    Me.RecordSource = "select * Sales.Paid = " & Me.ComboPaymentFilter.Column(2)
    Else
    Me.RecordSource = "select * Sales "
    End If
    Me.Requery
    End Sub

  4. #4
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    can you post your database just a table with sample data and that form.. in it..

  5. #5
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    what do you have for your row source in your combo box..

    and in me.recordsoruce = "select * From sales"

  6. #6
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    me.recordsource = "select * from sales where paid = " & me.comboboxname.column(2)

  7. #7
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    when you setup a combo box.. you can select type my own values..

    you need 3 columns

    0;ALL;FALSE
    1;PAID;TRUE
    2;UNPAID;False

  8. #8
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126
    i have taken out all the extra bits to the database the form i added the code into is record customer sales....

    thanks
    Attached Files Attached Files

  9. #9
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126
    oh ok, i did type the values in but didnt add the numbers below the values

  10. #10
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126
    i just tried the way you said to type the values in with 0, 1 and 2 in front but that shows in the list box too?
    Quote Originally Posted by alcapps View Post
    when you setup a combo box.. you can select type my own values..

    you need 3 columns

    0;ALL;FALSE
    1;PAID;TRUE
    2;UNPAID;False

  11. #11
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    Sweet Temptations - Copy.zip

    ok got it to work.. but you have many things that were not setup right.. take a look..

    I would change the form to show second form inside that form to show all the transactions..

    then sales inside another form.. that way you would have a datasheet view of all sales by customer.. then clicking on that sale would give you the details.

    anyway this works.. check it out..

  12. #12
    tweety is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2012
    Posts
    126
    can you explain abit more what iv setup wrong please?

    and i didnt understand the the form view you mentioned, can you please explain abit more

    thanks

  13. #13
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    yes.. you entered a single line of input in your combo box.

    Hm where do i put these 3 lines of code:
    0;ALL;FALSE
    1;PAID;TRUE
    2;UNPAID;False

    when entered into the combo box source
    it should have been like this
    0;ALL;FALSE;1;PAID;TRUE;2;UNPAID;False

    column count should have been 3 not 1
    I changed the false to 0 and true to -1

    in your filter button after update.
    you were pointing to the main form

    you were trying to change the records of the sub form

    you left out the from sales in the record source

    you can go to microsoft and look at templates of sales they have a better explanation than I can give you.
    Look at their example and try to use them.

    http://office.microsoft.com/en-us/te...2Db8e6b8350a15

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-29-2012, 11:28 AM
  2. Multiple True/False columns, forcing behaviour
    By RoscreaMou in forum Access
    Replies: 8
    Last Post: 05-08-2012, 04:24 PM
  3. Replies: 7
    Last Post: 01-11-2012, 12:24 PM
  4. Yes/No True/False
    By DSTR3 in forum Access
    Replies: 5
    Last Post: 12-04-2010, 05:56 PM
  5. True or false
    By tleec in forum Queries
    Replies: 1
    Last Post: 02-01-2008, 10:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums