Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    14

    Unanswered: Problem setting RowSource property in code

    I have a form with a combo box. The RowSourceType is Value List. In code, I'm adding items to the RowSource property. But when I close the form and go back in, the items I added programmatically are not in the drop down list (the RowSource property wasn't saved)

    I've tried saving the form each time I update the RowSource Property.

    This happens both in Access97, appending to the string like:
    Me.ComboBox.RowSource = Me.ComboBox.RowSource & "; " & strNewItem

    Also, this happens in AccessXP, using the AddItem method.

    Any suggestions?

    dk

  2. #2
    Join Date
    Jan 2003
    Posts
    3

    Arrow Re: Problem setting RowSource property in code

    Originally posted by dkuttler
    I have a form with a combo box. The RowSourceType is Value List. In code, I'm adding items to the RowSource property. But when I close the form and go back in, the items I added programmatically are not in the drop down list (the RowSource property wasn't saved)

    I've tried saving the form each time I update the RowSource Property.

    This happens both in Access97, appending to the string like:
    Me.ComboBox.RowSource = Me.ComboBox.RowSource & "; " & strNewItem

    Also, this happens in AccessXP, using the AddItem method.

    Any suggestions?

    dk
    Try this:
    Me.ComboBox.RowSource = Me.ComboBox.RowSource & "; '" & strNewItem & "'"

    Use single quotes to surround your new item
    Hope this helps.
    Gene

Posting Permissions

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