Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing data from fields (access 2000)

    Hello, how do I click on an entry in a drop down list combo then have that entry populate another text box on a form. I need to repeat this process a number of times so each click adds a further entry to the text box.

    Many thanks

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing data from fields (access 2000)

    Before I give you the wrong answer, could you clarify a couple of things?
    1. <LI>Are the combo box and text box on the same form?
      <LI>When you say "each click adds a further entry to the text box"...do you mean that it will overwrite the last entry into the text box?
      or are you creating a list of data inside the text box?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing data from fields (access 2000)

    Thanks Trudi, yes the combo and text are on the same form and each click adds further data to the text box, not an overide of previoud data.

    Cheers Darren

  4. #4
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing data from fields (access 2000)

    Thanks Darren... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    All you have to do is add an expression to the AfterUpdate event procedure for the combobox...
    Something like this:

    If txtYourName <> "" Then
    txtYourName = txtYourName & ", " & cboYourName
    Else
    txtYourName = cboYourName
    EndIf

    I don't know what format you're needing the output in, but I've attached a quick example I made...
    It just has one table and one form... but hopefully it'll help give you ideas and help get you started...

    Let me know if something doesn't make sense...

    HTH
    Attached Files Attached Files

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing data from fields (access 2000)

    Trudi, you are wonderful.

    Thanks

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Passing data from fields (access 2000)

    Not taking anything away from Trudi's solution, you could try replacing:

    If txtYourName <> "" Then
    txtYourName = txtYourName & ", " & cboYourName
    Else
    txtYourName = cboYourName
    EndIf

    by the following statement:

    txtColorList = (txtColorList + ", ") & cboColorDescription

    Notice the + is used instead of the &.
    What happens is that the expression (txtColorList + ", ") evaluates to Null the first time it's used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •