Results 1 to 2 of 2
  1. #1
    JPS is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    1

    How to use form to read and write values to master list

    Hello,
    I have a table called Master Records that contains the field "Title." This is the primary key that references several other tables in the DB.



    I have a form to manually enter data for different tables- one of the fields in the form is "Title," and the data is pulled from the Master Records table. with this construct, I am limited to select only data that already exists in the Master Records table. I would like to use the form to add a new "Title" record to the Master Records table if it does not already exist in the table. I don't want to open a separate form to enter the new "Title." I envision something like how Excel works, where it tries to auto-fill the text if it matches previous records, but once you type something that does not match, it abandons the auto-fill and allows the user to complete a new record.

    Is there a way to use a form to both read records from a table, but also to write a new record to the table if no match is found? Thanks!

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Hi,
    For this you have to write code on after update event of the masterfield on your form:

    Which should check:
    1- is the title is already used in the master table?
    2- if yes, then don't do anything and use the master title.
    3- else INSERT the new Master Title in the master table and give message (optional)
    4- requery and refresh the combo box to use the new master title.

    The above is rough idea on after update event on the field/combo on form. the code can be written after examining your master table fields.

    Best Regards,

    Khalid Afridi

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

Similar Threads

  1. Replies: 9
    Last Post: 12-17-2010, 01:04 PM
  2. Some Can Read; Some Can Write
    By cassidym in forum Security
    Replies: 3
    Last Post: 08-19-2010, 02:19 PM
  3. Master list table with changing values.
    By evander in forum Database Design
    Replies: 11
    Last Post: 06-24-2010, 07:40 AM
  4. ODBC table read to blank Access table write
    By dibblejon in forum Access
    Replies: 2
    Last Post: 03-10-2010, 08:39 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04: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