Results 1 to 2 of 2
  1. #1
    cfahy is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    1

    Form ComboBox Column Value to Table Field

    Hi,

    This should be simple, but I'm pretty new to this, so I hope you can help.



    I have a table (tblFeedback) with 4 fields (ID, UserName, cbCriteria1 and Score1)

    I also have a form (frmFeedback) with Criteria1 as a combo box with lookup values of "yes" and "no" and score (5 for Yes, 0 for no)

    I want to be able to update the field Score1 based on the combo box selection.

    I thought if I create a form field and set it's Control Source to [cbCriteria1].[Column](2) it would also update the table field Score1. Not so. Can anyone give me a clue of what I'm doing wrong?

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    cfahy -

    You could try setting the control source of the field to...

    =[cbCriteria1].Column(1)

    Assuming the score in the combo is in column 2. Note: When making a reference to a column in a combo you always start with 0 for the first column and increment up from there.

    Edit: I apologize, my mistake. An easier way to do this is in the AfterUpdate Event of the combo box using VBA since you don't want to change the control source of Score1.

    the code would look like:
    dim x as Integer
    x = Me![cbCriteria1].Column(1)
    Me![Score1] = x

    Sorry, evidently I'm having a distracted day.


    Hope this helps,

    Jim
    Last edited by ketbdnetbp; 08-09-2011 at 06:25 PM. Reason: Missed part of original post

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

Similar Threads

  1. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  2. create new column-name it from form field
    By hyperionfall in forum Forms
    Replies: 6
    Last Post: 03-04-2010, 01:53 PM
  3. Replies: 0
    Last Post: 12-16-2009, 01:14 PM
  4. Replies: 1
    Last Post: 08-14-2009, 08:41 AM
  5. Link ComboBox to field in a table
    By DrDebate in forum Forms
    Replies: 0
    Last Post: 04-27-2007, 08:03 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