Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    MarcA-D is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    10
    Hi,
    Im not to sure what the other form does I don't think we are talking about doing the same thing now unfortunately. Would you be able to explain what the A_A_age... form does as I cant see it doing anything still. when I open the test data form and select the age brackets I want and then click the button it takes me to the other form which just shows 56-60 no matter what I click on the form before that. Just to try to make sure that it is clear what I want to do ill explain it a little bit more. In the DB that I uploaded in my last post, there was a form and a table, I want to use that form to make a (like) statement sort of so it can then search the table test data using a query that in the future will also have other bits on it to try to narrow down the search, for example if i where to click 36-40, 41-45, 46-50, 51-55, and 56-60 it would then some how make a query that would search for them age brackets and then show them in a table. I know that you cant do this like how i have said it but i assume there is a way that it could be done its just finding out how to do it. I have uploaded a 3 step process to sort of show what I want to happen.
    Thanks Once again Marc
    Click image for larger version. 

Name:	Test DB explained.jpg 
Views:	5 
Size:	50.1 KB 
ID:	21188

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    As I mentioned, the first form is setting the second form's Filter property to equal the WHERE criteria the first form created. The first form created the WHERE criteria. This criteria can be applied to different things, e.g. the definition of a Query Object. In the sample DB file, the WHERE criteria is being applied to a form's Filter property.

    When the second form opens, look at the form's lower left hand corner. The lower left hand corner is where the Navigation Buttons are located. Here you can see buttons that allow the User to navigate through the Form's Recordset. The Filter property has an affect and which records within the Recordset are visible to the user. The form is bound to the table. Because the Filter property has the WHERE criteria applied, the number of records available via the Navigation Buttons are less than the number of records in the table.

    Another way to illustrate this is to open the second form in Datasheet View. You can adjust the code in the first form to open the second form in DS view.

    Replace
    DoCmd.OpenForm "A_A_age_groupQueryTest", acNormal, , strWhere

    With
    DoCmd.OpenForm "A_A_age_groupQueryTest", acFormDS, , strWhere

  3. #18
    MarcA-D is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    10
    OK it works great now. Would I have to have a second form or can i just run it off the first form? I have also just noticed sometimes when i run the form it pops up with a box saying band i have attached the image of this so you can understand what i'm talking about.

    now that that is sort of working how would i then add other boxes on the first from to search for other things, for example if i had a field in my table that showed if they owned a home i would be able to select that field has to be "home owners" it would then show people in the correct age banding and if they own a house ?

    Thanks alot marc


    Click image for larger version. 

Name:	band pop up box.png 
Views:	5 
Size:	149.5 KB 
ID:	21189

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I noticed that error too. It seems that a couple of the controls may be corrupt. I would suggest not using special characters in the names of your controls. The names you used for your controls may be the cause of the error. Take a look at the naming convention I suggested in post #5.

    So, you can place those unbound controls on your original form. Maybe they could go in the form's header. Then, the button could apply the strWhere variable to the current form's Filter property. One thing to remember about the filter property is that it can be removed/altered by the user via Access' intrinsic tools. So it may be misleading if a checkbox is ticked and the user then changes the filter settings.

    Code for applying WHERE criteria to the current form's Filter property will look something like this ...

    Code:
    me.filter = ""
    me.filteron = false
    me.filter = strWhere
    me.filteron = true

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. List to check boxes
    By tanyapeila in forum Reports
    Replies: 3
    Last Post: 03-27-2014, 01:20 PM
  2. Replies: 4
    Last Post: 10-16-2013, 07:07 AM
  3. Replies: 2
    Last Post: 06-24-2011, 06:38 AM
  4. List box column check..
    By empyrean in forum Programming
    Replies: 1
    Last Post: 10-28-2009, 08:18 AM
  5. Replies: 0
    Last Post: 02-24-2009, 12:37 PM

Tags for this Thread

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