Get the rowsource from a field (1 Viewer)

D

duckdodgers

Guest
Ok... I give.

I am populating tables from an Excel workbook via an ADO connection.

I have a table that has a text field with a combobox lookup display control using a value list rowsource type. The rowsource is manually entered values. I need to lookup a value from the workbook in the rowsource to ensure that the entry is valid. I do have the "Limit to List" set to "Yes", but I can still add an entry that is not in the rowsource via the VBA routine.

This seems like this should be simple, but I have gone through the knowledge base with no success. I apparently must be missing something.

Thanks for any help.
 

pdx_man

Just trying to help
Local time
Yesterday, 21:16
Joined
Jan 23, 2001
Messages
1,347
Before you add the entry in VBA, check that the new value is part of the rowsource for that combo box.

If Instr(NewVal, Me.Combo1.Rowsource) Then
Add the value
Else
Don't add the value
End If
 

Users who are viewing this thread

Top Bottom