Results 1 to 7 of 7

Thread: Problem

  1. #1
    Join Date
    Nov 2005
    Location
    Sweden
    Posts
    29

    Question Unanswered: Problem

    Hi I've got a bit of a problem.
    I need to be able to create a form which need to contain some kind of list function for dates etc. The problem is that i need to be able to insert new data in that same "listbox". How can i do that?

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    If you ListBox has the Row Source Type property set to Value List then:

    Me.myListBoxName.AddItem Item:="This is my data"

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Nov 2005
    Location
    Sweden
    Posts
    29
    um where do u insert that row?

    My table companyname which has a one to many relationship with rednr
    needs to be able to look up all the rednr and add them to a list in a form.
    But I need to be able to insert new rednrs in that list aswell.

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Ok then...whenever a new rednr is applied to the database table then simply requery the list box:

    Me.myListBoxName.Requery

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  5. #5
    Join Date
    Nov 2005
    Location
    Sweden
    Posts
    29
    Sorry if I seem daft, I'm kind of a newbie.

    I dont understand where I should input that me.mylistbox.requery row and so on.

    What I want to do is this:
    Make a form where the user inputs a company name etc,
    Then i need to have a list of the rednrs thats connected to that companyname, but I want it to be possible to insert new rednrs in that same form. How do I do that?

    I tried making a form with a subform that contains the rednrs. The problem with that is that I can't insert new numbers without having to make a column with the companyname next to it.
    I'd like to be able to input new rednrs in the subform without having to insert the companyname everytime.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Do you have a relationship defined in access between the two tables?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Nov 2005
    Location
    Sweden
    Posts
    29
    Quote Originally Posted by Teddy
    Do you have a relationship defined in access between the two tables?
    yep the relationship is 1 - Many between companyname and rednr
    Last edited by ionizer; 11-17-05 at 10:33.

Posting Permissions

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