Results 1 to 15 of 15
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Button to perform Query (2002 SP3)

    In the attached database, on the Permit Information Form, I would like to have some kind of button (next to the Print button) which will perform a query and display results.

    - If no record is found, Display 'Record not Found'
    - If found, Display the Person's Name, Address, and Last Date Issued.

    The goal is to limit people from accessing the Table in order to preserve it from any corruption. What would be the easiest way to do this taking into account that the people using this database are pretty much beginners in Access?

    Thanks.
    Pooja

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    What "query" would you like to perform? Please try to be specific.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    Pooja,
    To limit user's abilites to edit info, you could create a form that opens in datasheet view, and through the design view you can lock/unlock fields for editing, as well as permissions to add/delete, etc...
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  4. #4
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    The query would be to search for the Address (sort of like the Query I currently have stored in the Queries area).

  5. #5
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    Thank you for the suggestion. Unfortunately, I have no idea how to create something like that just yet. I'll research and see if that's feasible!

  6. #6
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    Pooja, if you use the wizard to create your form, (or even if you don't) you can use the following line on your On Click event to open the form as a datasheet:

    DoCmd.OpenForm "yourformname", acFormDS
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    Does the combo box in the form header in the attached version do what you want? It was basically created by selecting the 3rd option in the Combo Box Wizard.

  8. #8
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    First, thank YOU so much for your help. It works somewhat so let me give you a background on what we're trying to do.

    Within City limits, residents of our city can purchase $10 parking permits for the year to park in our historic district. We have two new people starting you are going to be in charge of handing these parking permits out. What we want to do is just to have them open up the database, have something similar to a search pop-up with a field that says Street Address, have them input the address and if anything is found, have the Permit Information Form automatically filled with the pertinent record information. The form will be pulling the information from the Permit Information Table once it's populated. Currently I only have five or six sample entries in there but eventually it'll contain about 130,000 (that's how many residents we have). The results we do have to have showing are: Street Address, Date of Permit, and Name of Person.

    Whatever way would be the easiest for them to manipulate is fine. If you need names of the streets within our city, just use the All Streets Table since that is accurate as of this morning. My idea was to put a SEARCH button on the form itself that they can click and have the field(s) open up but if you think some other way is easier, that's fine with me!

    I hope that's clear enough. If you need more explanation, let me know. I'm pretty new to Access so bear with me if I ask very simplistic questions.

    Thanks.
    Pooja

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    What are you going to fill in for First Name and Last Name if the Owner Name field in All Streets is "JAMAS FAMILY TRUST" or "CAPISTRANO GARDEN HOMES"?

  10. #10
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    I'll use everything but the LAST word for my First Name and the Last word for the Last name.

    Example:
    JAMAS FAMILY TRUST = First Name will be Jamas Family, Last Name will be Trust
    CAPISTRANO GARDEN HOMES = First Name will be Capistrano Garden, Last Name will be Homes

    Thanks.
    Pooja

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    This could get nasty. Following the same principle, the owner name "LACOSS ROBERT A" (from the first record in the All Streets table) would have first name "LACOSS ROBERT" and last name "A", and the owner name "COOPER TOBY" would have first name "COOPER" and last name "TOBY". It won't be easy do devise an algorithm that decides whether the owner name is a person or some kind of organization/company/group/trust.

  12. #12
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    We can separate out the two fields and make one Company Name, and the other the person's full name. Would that work?

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    If you can do that, please separate the name field into first name, last name and middle initial too, that'll save a lot of trouble.

  14. #14
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Button to perform Query (2002 SP3)

    Hello Hans,

    As requested we've separated the first, middle, last and company names in the new table. The table we wish to use in the database is Permit Information 2005-2006 NOT the All Streets table. That's simply in there so we can get all the City streets in the form correctly.

    How should I proceed from here?
    Pooja

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Button to perform Query (2002 SP3)

    You can create a query based on All Streets that includes ID1, Prop Address and the first, middle and last name plus company name fields.
    Use this query as row source for the combo box, and expand the number of columns accordingly.
    Set the Control Source of the text boxes for first name etc. on the form to something like

    =[Street Address].Column(2)

    This refers to the 3rd column of the combo box - the columns are counted starting at 0.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •