Results 1 to 3 of 3
  1. #1
    michael_bsog is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Oct 2017
    Posts
    1

    Combo Box causes Append Query to Store Wrong Date in Table

    I have a table populated in a form by two combo boxes. One combo box links to a table of available assignments. The other links to a table of available personnel. By using the two combo boxes I have a table with people assigned to assignments and all of their other associated data, so that I can mail merge to Word. I append this data to a temporary print table.

    The problem is that the assignment combo box is storing a list index (the assignment number is itself the primary key for the assignments table from which the combo box is bound).

    SO, when I mail merge, rather than an assignment number like "094-1029", I get something like "5" or "6" which corresponds to the order the assignment number was placed in the list.



    My question is, how do I force the append query to append the actual assignment number and not whatever list index or bound value Access is using to associate with the assignment number.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    if the combo box is BOUND to the index, then it will send the index.
    if the Assign# is in another column, then do this:
    when the user picks the Assign# in the combo, write the # to a text box in the afterupdate event. (it doesnt have to visible)
    then the query can use the textbox in the query

    Code:
    sub cboAssign_afterupdate()
       txtBoxAssign= cboAssign.column(1)          'NOTE: in vb code, columns start with zero, so col(1) is the 2nd field IN the combo box
    end sub
    now run query that appends txtBoxAssign.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Perhaps you have set the bound column to be 0? That will cause the list index to be the bound column. Perhaps you meant to bind to the assignment number and that value is in column 1?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 19
    Last Post: 10-03-2017, 09:10 AM
  2. Replies: 4
    Last Post: 11-16-2016, 08:14 PM
  3. Replies: 5
    Last Post: 08-12-2016, 11:08 AM
  4. Replies: 1
    Last Post: 11-16-2014, 09:10 AM
  5. Replies: 15
    Last Post: 07-20-2013, 12:42 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