Results 1 to 10 of 10
  1. #1
    thalor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5

    Simple problem. Newbie Question

    I'm sure it's been addressed before, so I apologize in advance.

    I'm trying to set fields from a dropdown list in a combobox

    The form (ContactList) that the combobox (combobox1) references has



    First Name, Last Name, ID

    What I want to do is when selecting the Name of the Person, to set another field on the form (ContactID) to be the ID of the person selected.

    Simple, but I have not a clue on it. I've searched google using terms I thought would be close to no avail....so again I apologize if this has been answered here.

    An answer or a link to another article would be most helpful!

    Thanks

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if that is how your data is laid out in your combo box (First name First, Last Name second and ID third) you want your BOUND COLUMN setting of your combo box to be column 3.

  3. #3
    thalor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5
    Well I forgot to mention (my fault) I need to set a different field with the ID while the bound part is the Last Name. Sorry about that, but thanks for the reply!

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    do *NOT* set the bound column to anything but the ID field, you are asking for a world of trouble if you do.

    For instance
    Kate Smith has ID 1

    If kate smith gets married and changes her surname to Jones and are adding data to any tables using the LAST name, you will orphan everything related to Kate Smith.

    Further, if you have 15 Smiths at your business there is absolutely no way to determine which smith you are talking about when you look at your child tables (any table where the employee is referenced other than the employee table that has the ID field).

    the BOUND field does not mean that's the field that's visible, it just means use the value in column X when you store the data.

  5. #5
    thalor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5
    Got it. Thanks for that tip! Is there any way to concatenate the First and Last Names in the Combo box?

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Yes:

    PersonName: [Lastname] & ", " & [FirstName]

  7. #7
    thalor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5
    Sory to keep bothering, but you seems to be an expert on this....

    With the press of a button how would I create a new record in a table (Shows-People) with the relevant fields on a form.

    Fields are : ShowName,ContactID,Position

    The fields in the table are named the same as the form.

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You shouldn't need to press a button at all

    if you create an UNBOUND combo box that lists all your contacts where the CONTACTID is in the BOUND column, create your form based on a SQL statement or QUERY where the criteria of the CONTACTID field is

    [forms]![formname]![comboboxname]

    then in the ON CHANGE property of your UNBOUND combo box put in the code

    me.requery

    Every time you select a new person from your combo box their record will be displayed.

  9. #9
    thalor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    5
    I get what you are saying, what I want is to select data from those comboboxes and put it in another table (not where the comboboxes are getting the data)

    IE
    I select
    "Show 1" from Show
    "223" from ContactID
    "Admin" from Position

    now on that form I see the data but I want to PUSH these 3 things to another table (Shows-People) to create an all new row in that table.

    I hope Im explaining myself well...Access programming is very new to me

    Thanks

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Build a form bound to Shows-People (set form RecordSource property). Bind comboboxes to the fields of Shows-People (set ControlSource property). Value selected in combobox is saved into record. This is basic Access functionality.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Hi and a newbie question :)
    By wheelspin in forum Queries
    Replies: 3
    Last Post: 11-28-2011, 01:11 PM
  2. Newbie question please help
    By Napier in forum Access
    Replies: 1
    Last Post: 11-28-2011, 09:00 AM
  3. Simple problem from a newbie user
    By jimmy2x2x in forum Access
    Replies: 3
    Last Post: 10-23-2011, 04:36 PM
  4. Newbie, seems simple to lookup value?!
    By ayce123 in forum Queries
    Replies: 3
    Last Post: 03-13-2011, 12:22 PM
  5. Question from a newbie
    By scarps626 in forum Access
    Replies: 2
    Last Post: 10-02-2009, 03:40 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