Results 1 to 5 of 5
  1. #1
    cwild is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    5

    Auto add field info dependent on selection in other field

    I know this is pretty simple and I apologise but I just can't seem to get this.



    I have a form that pulls infomation from one table but allows you to add new bits of information to another table.

    All I want to do is when I select a passport number from the combo box 3/4 other boxes which also contain data from the same table update and show the relevant data from the same row.

    ie. I pick [passport number]

    [Common name] updates to show what is it.

    I have seen reference to after update Event's but I am new to access (used to Excel and coding) and VBA etc is running rings round me here.

    Any help much appreciated.

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi,

    I don't know, but reading your post I get the feeling your database design isn't what it should be. Access tables should never contain repeating information. If so, you have to split them in separate tables, for instance a table with personal data (passport number, name, ...) and a related table with the other information, that can occur more then once for each person.

    when you have a correct database design, the construction of queries and forms gets a lot simpler.

    greetings
    NG

  3. #3
    cwild is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    5
    I have different tables for different things.

    ie passport table
    Personal details table

    However I would like the Form that the user see to drop in associated data from the same table into the form.

    I do not like data duplication, but am also aware that the end user likes to see certain information.

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi,

    you can add a combo box to the form. Be sure the bound column is set to the value that has to be filled in the underlying table. In the next columns of the row source property you put all values you want to show. set the column count property to the number of columns you have, and set all column widhts of the cols you don't want to show to 0.
    Then create an unbound textbox for all extra values you want to show. then set their contyrol source property to = [NameCombobox].[Column](n) where n = the number of the column, taking into account access starts to count the columns from 0.

    Hope this helps
    NG

  5. #5
    cwild is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    5
    ahhhh that looks like what I'm looking for! Will try and get back to you.

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

Similar Threads

  1. Populate a field based on combobox selection
    By rscott7706 in forum Access
    Replies: 5
    Last Post: 06-02-2011, 03:18 PM
  2. Replies: 5
    Last Post: 01-20-2011, 11:36 PM
  3. Combo Box field selection help needed
    By techexpressinc in forum Forms
    Replies: 8
    Last Post: 04-01-2010, 09:42 AM
  4. Replies: 13
    Last Post: 11-25-2009, 03:10 PM
  5. Setting a field to be dependent on another
    By CushingMT in forum Forms
    Replies: 0
    Last Post: 11-19-2008, 11:51 AM

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