Results 1 to 5 of 5
  1. #1
    Lupson2011 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    68

    Automatic Field DAta Entry

    Hi, I have a table with the field names Trust1 (which is a 5 digit code) and Trust3 which is the name of the organisation. There is a code for every corresponding org name.on a form, I have a combo box which you can choose the org name (Trust3). I also have a text box with Trust1 (5 digit code) as the control source.What I want to do is when I have chosen the org name (trust 3), the corresponding code (trust1) appears in the text box for that org name automatically. Does anyone have the handy code for this small procedure?thankslupson2011

  2. #2
    LillMcGill is offline Dagny fan
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    I don't understand what you're doing... it sounds like you're storing both the Org name and the Org code in a related table, so I must be misunderstanding.

  3. #3
    Lupson2011 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    68
    The org name and org code are already in a table. What I want to do is when you choose the org name from a combo box, I also want the corresponding org code to display in the text.So basically, its is saying, 'ok you have chosen 'Avon', here is its corresponding org code. AVON1 (displayed in the text box)Am sure it is something that goes behind the text box or the combo box?Hope thats a little clearer?Lupson2011

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm assuming the Trust1 field is a unique key, in other words it can't (and isn't) duplicated anywhere in your table?

    If so make you combo box have two fields, the first being TRUST1 (the bound column) and the second column be Trust3. Set the column count to 2, set the column width line to 0;2.

    Make the field where you want the trust1 information to appear an unbound text box set the control source to =[comboboxname] where comboboxname is the acutal name of the combo box on your form.

  5. #5
    LillMcGill is offline Dagny fan
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    Your post title says "Automatic Field data Entry", so I was concerned that you were trying to do automatic field data entry.

    Here is a sample, where the combo box has 3 columns, but the column widths are 1.5;1.5;0
    cboStatusId Row Source:
    Code:
    SELECT [tblStatus].[StatusID], [tblStatus].[StatusCode], [tblStatus].[StatusName] 
    FROM tblStatus 
    ORDER BY [StatusCode];
    And to DISPLAY the Statusname in a textbox, set the textbox Control Source:
    Code:
    =cboStatusId.column(2)

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

Similar Threads

  1. Limit data entry based on another field
    By chemengr in forum Forms
    Replies: 5
    Last Post: 01-02-2014, 01:21 PM
  2. Replies: 4
    Last Post: 01-23-2011, 09:01 PM
  3. Access 2003 automatic field entry
    By RANCHLAW56 in forum Forms
    Replies: 6
    Last Post: 12-30-2010, 02:57 PM
  4. Can't get new field to show in my data entry form
    By Suzie in forum Database Design
    Replies: 19
    Last Post: 12-21-2009, 03:48 PM
  5. Automatic Data Entry on a Specific Date
    By alanbrai in forum Programming
    Replies: 2
    Last Post: 11-14-2007, 05:15 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