Results 1 to 4 of 4
  1. #1
    Patel79 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2017
    Posts
    2

    Query Form or Report?!?

    Hi all - Good morning!



    I'm fairly new to Access so please excuse my ignorance.

    I have a table with States, Zip Codes, Counties, and some other columns that have the pertinent data.

    I would like to create a (Form or Report?) that you can open, Select the state(s) and the data under the state(s) appear - OR the user can select the State and Zip Code(s) the data for those to appear OR just zip code Or any combination.

    Is this possible? If so, can you please help me our or point to where I can find the info?

    Many many thanks everyone!!!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    make a form that shows all records, (continuous form)
    in the header put a combo box that has all states.
    a text box for zip codes.
    when user selects a state in the combo, filter the records to see only those records.
    below is the code to do this:

    Code:
    sub cboState_Afterupdate()
    if isNull(cboState) then
       me.filterOn = false
    else
       txtZip = null
       me.filter = "State='" & cboState & "'"
       me.filterOn = true
    end if
    end sub

    'vb for zip code box
    Code:
    sub txtZip_Afterupdate()
    if isNull(txtZip) then
       me.filterOn = false
    else
       cboState = null
       me.filter = "ZipCode='" & txtZip & "'"
       me.filterOn = true
    end if
    end sub

  3. #3
    Patel79 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2017
    Posts
    2
    Thanks so much RanMan!

    Coding - uggh! I thought this could be done without coding haa. I'll definitely try this but real quick - apologies if my description was off, but instead of an input for zip code, I would like to have (multi)selection of zips under any given state/county.

    For example a I can select State: GA, then I can either select the County or simply select the zips I need. OR I can select the state, then select the county(s) and the zips that fall under those county(s).

    I hope that clarifies, and thanks again!

  4. #4
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    in the Continuous form, put your cursor in any field and right click - there you will see both sort and filter features - experiment with this.... if you seek to avoid coding this is an option

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

Similar Threads

  1. Replies: 3
    Last Post: 03-11-2013, 05:11 PM
  2. Replies: 2
    Last Post: 01-30-2013, 07:34 PM
  3. Query by Form to Report
    By funkygoorilla in forum Queries
    Replies: 10
    Last Post: 12-13-2011, 01:29 PM
  4. Replies: 1
    Last Post: 07-15-2011, 10:59 PM
  5. Report From Form Based Query
    By cartotech81 in forum Reports
    Replies: 1
    Last Post: 02-16-2011, 06:33 PM

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