Results 1 to 2 of 2

Thread: Help,Saving a Combo Selection!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73

    Post

    I am trying to save whatever is selected in a combobox with the following but to do that I have to find the 'ID' from one table of that selection and save it another. To start it is saying 'Too few parameters for this sql: any suggestions or examples of code that you used in saving a selection from a combo box that hooks to a different table. Thankyou I haven't gotten any replies from my last few posts and I am wondering why.

    sqlAgnt = ("Select agentid from Agents where Agents.Agent = cboagent.selecteditem")


    Set tbAgnt = db.OpenRecordset(sqlAgnt)

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    3

    Post

    try the following line
    sqlAgnt = ("Select agentid from Agents where Agents.Agent = '" & cboagent.list(cboagent.listindex) & "'". I'm not sure if this is what you are looking for without knowing a few more specifics about your progam but I bewlive this syntax is correct. Also if it makes sense, when you populate the combo box there is an "ItemData" property that may be usefull to you. Look it up in help.
    Rob


Posting Permissions

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



Click Here to Expand Forum to Full Width