Results 1 to 4 of 4
  1. #1
    N7925Y is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2016
    Posts
    32

    Search Form Error


    I have a database with a search form. This search form allows me to search on "First Name", "Last Name", and or "District". When the search form was originally built the table it was based off of had the names and addresses all in one. I have since refined the database and normalized the tables separating the names and addresses. I have updated the search sub form's query so it pulls the names from that table and the addresses from the proper address table. Unfortunately when I open the form I get the "Enter Parameter..." Message box. And when I try to run a search I get a code error. I have attached a copy of the sample database. I'd appreciate any advise that can't be given on how to fix the code to correct this. Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    It appears that your "district" is not in the table you are querying. You will need to join the address table to the voters table in your query. The parameter is opening because it cannot find "district" in the voters table.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Alan is correct. You are trying to use a field that is not in your table.
    It also appears to me (and I've probably forgotten details we have discussed in earlier posts) that your relationships may not meet your requirements.

    If there is only 1 address per voter, then 2 tables may not be necessary. I'm not following the VoterAddress table, if voter to address is a 1 to 1 relationship.

    I have not reviewed our earlier conversations on this. I saw Alan's response, did some checking and agree with him.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by orange View Post

    ...If there is only 1 address per voter, then 2 tables may not be necessary. I'm not following the VoterAddress table, if voter to address is a 1 to 1 relationship...
    I agree! We often speak of a database being Non-Normalized...but on the half-a-dozen forums I travel through, each day, I see a fair number that are what I call Over-Normalized, and being so designed causing their developers all kinds of unnecessary problems! The general rule is that if their is only one entry for a given piece of data, i.e. you'll only record one address per voter, that Field should be in the same Table as the voter name...ditto for phone number. You'd only need a separate Table for addresses if you want to record multiple addresses per voter.

    Last week I saw a post (elsewhere) where the poster was doing a fast and dirty db for a class re-union. He was only recording name, address, phone and attending/not attending...but had separate Tables for

    Classmate Name, Address, City, State, Zipcode, Phone Number and Area Code!

    And, being a novice, was completely overwhelmed when trying to pull up a classmate's record by retrieving data from seven Tables!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. error in create search form with combobox
    By navid136220 in forum Forms
    Replies: 1
    Last Post: 08-13-2016, 05:08 PM
  2. Replies: 15
    Last Post: 08-28-2015, 07:43 PM
  3. Code for search form error
    By jfn15 in forum Forms
    Replies: 4
    Last Post: 06-11-2013, 09:02 AM
  4. Navigation Menu and Search Form error
    By pbouk in forum Forms
    Replies: 5
    Last Post: 03-06-2013, 12:42 PM
  5. Replies: 7
    Last Post: 09-21-2012, 03:30 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