-
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)
-
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