Results 1 to 6 of 6
  1. #1
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32

    Exporting combo box data to separate field in form


    O.K. I've seen similar posts on this but just couldn't get the exact scenario that I am looking for. I have a form with a 2 column combo box that displays a list of form numbers and then the name of the form. Then there is another field in the form that is supposed to take what gets selected in the combo box and placed that data in the field. I want both the form number and the form description to show up in that next field. Right now, it will only show the description. Then I want that data to go into a table, but that isn't the main issue. I'm getting tht but want both to be placed in the table as one long string. Any ideas?

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Look here. Try using this approach and in the target text box, join the two columns with an ampersand (concatenation)

  3. #3
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32
    Where does that go? I have the control source as the table field I want the data to be placed in.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by alansidman View Post

    ...Look here...
    Look where?

    But alansidman's talking about something like this:

    Code:
    Private Sub YourComboBox_AfterUpdate()
      Me.TargetField =  Me.YourComboBox.Column(0) & " " & Me.YourComboBox.Column(1)
    End Sub
    assuming that the form number and form description ar the first two columns in the Combobox, starting at the left.

    Linq ;0)>

  5. #5
    stanley721 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    32
    That didn't do it. It gave me some error. Wouldn't that lock me into having to use what was selected from the combo box? I want the option that a person can select what shows up in the Combo Box or just go to the field and type in what they want. Then I want that data, no matter how it got there, to be placed in that field in the table. Is that possible? Seems like it should be.

  6. #6
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Linq;

    Thanks, that is exactly what I was proposing. BTW, the link I forgot to post is

    http://www.baldyweb.com/Autofill.htm

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

Similar Threads

  1. Exporting to Excel- losing data from combo box
    By SteveS in forum Import/Export Data
    Replies: 3
    Last Post: 07-17-2012, 01:07 PM
  2. Replies: 1
    Last Post: 05-09-2012, 02:22 PM
  3. Replies: 8
    Last Post: 03-18-2012, 11:17 AM
  4. Exporting Memo field Data to Word document
    By samlennox in forum Programming
    Replies: 2
    Last Post: 04-25-2011, 11:57 PM
  5. Separate combo box
    By sanos_a in forum Access
    Replies: 1
    Last Post: 10-07-2010, 05:30 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