Results 1 to 10 of 10
  1. #1
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73

    Actively look up existing records while typing entry into form

    There is a very good chance this is far more complicated that I am hoping, but I often overcomplicate things, so I thought I would ask after putzing around for a while.

    I have a table in which the name of an item is the primary key, since it will always be unique, and I don't want duplicate records. I am updating the number of the items, so right now what I do is search for the name of the item to see if it already exists (with Ctrl F in the form) and, if so, I update the number. If not, I make a new entry.

    I am trying to figure out if there is a way to have the form actively look at the table to see if the name of the item (primary key) exists and bring up that record if so to eliminate the search. Otherwise, it just lets me happily type away. Kind of a lookup with the source being the field in the table itself instead of a separate source table.



    I appreciate any guidance you may be able to provide. Thanks!

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    sounds like you are describing a combo box based on the table ID.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I agree with vicsaccess. I believe it is the "ComboBox.AutoExpand Property" in the Data tab of the combo box properties sheet.

    I wouldn't have the PK field a text type field. I would use an autonumber and set an unique index on the "name of an item" field.

    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp

  4. #4
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    Geez, that was way easier than I expected. I am glad I asked.

    I wouldn't have the PK field a text type field. I would use an autonumber and set an unique index on the "name of an item" field.
    I am curious, why is this a problem? I suspect there is a good reason or you would not have mentioned it.

    Thanks!

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I am curious, why is this a problem? I suspect there is a good reason or you would not have mentioned it.
    Did you read the link? Read the link again... it has lots of good info (I still refer to the link - it is one of my special reference bookmarks)
    Pay attention to "Use a Meaningless Primary Key"

    Good luck with your project...

  6. #6
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    Sorry. Missed the link. Thought it was part of your sig. I will get right on that.

    Thanks!

  7. #7
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    That makes a lot of sense. I am sure that is proper database management 101. That is what I get for fumbling my way through computer programming. Unfortunately for me, I am awful at learning anything computer related unless I am actively solving a problem. I have tried structured learning and it never sticks.

    Thanks again!

  8. #8
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    I have begun implementing the changes you recommended here. If I do not create a unique index, the form will pull up all of the information associated with the record. If I do index it, it will prefill the name but will not pull up information associated with the records for changes. In either case, it has the auto-expand property enabled.

    Any ideas what I am doing wrong?

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Hard to tell - Don't know which changes you have made. Is the auto-expand working?

  10. #10
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    Sorry for the delay in this post.

    I made no changes to the form. The only change made to the table was to index it. The auto-expand is not functioning either, but is still turned on.

    Thanks again for all your help!

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

Similar Threads

  1. Replies: 5
    Last Post: 01-17-2014, 02:27 PM
  2. Button to filter records when typing something in
    By Doodlebug2000 in forum Forms
    Replies: 1
    Last Post: 12-06-2012, 02:21 PM
  3. Replies: 6
    Last Post: 04-27-2011, 06:12 AM
  4. Replies: 0
    Last Post: 02-09-2011, 03:10 PM
  5. Replies: 3
    Last Post: 08-17-2010, 02:24 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