Not in list error - 2455 run-time

Aha. Its in the table as a yes/no field. I will add to the form.
 
Should probably automate that field and not rely on user to make entry or don't restrict the combobox list.
 
@June7 can I set the value with OpenArgs in my acFormAdd line?
I did try but its not happy. I added a checkbox to the form directory

DoCmd.OpenForm "frmDirectory", acNormal, , , acFormAdd, acDialog, CmbSubconsultant & Chr(165) & NewData, True
Set Me.ChkSubbie = True
 
your combo (directory) rowsource must only include "Sub Consultant".
 

Attachments

I have reviewed my code again and realized it works because combobox is unbound and has only 1 field in RowSource. Your combobox is bound and has a RowSource with alias - it saves ID but displays name. In your case, setting combobox to NewData fails because this also populates field which expects a number value. Couple options to make my approach work.

1. Pass ID of new tblDirectory record back to calling form and set combobox to that value. Methods of passing value are global variable, TempVars, OpenArgs, one form directly sets value of control on another form, or calling form pulls value from opened form and then closes called form.

2. Loop throuh combobox list until match to NewData is found in the non-bound column.

I have used all these techniques with exception of TempVars.

So unless Arnel has provided a solution, do you want to pursue this further?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom