I have this form where the user can entry a color of car in a combobox that is linked to the CarColor column, but I want it in a way that the user cant enter a color that he has entered before.
Example: the user typed White some days ago, but now he has forgotten that he typed it, and when he tries to type White on the combobox again, I want it to pop up an error window because that value is already on the table.
Basically I need a way to limit a combobox based on the table column that it is linked to.
Im willing to use macros.
I just need this bcz Im not the one who will be using the database, so i need to limit the data that enters it. This “DBColor” table is linked to the “DBCar” table, where I have a listbox of the colors that were input, but i need the user to enter them, bcz I dont know the colors of the cars that he will need to use.
I want something that looks like this:
REM ***** BASIC *****
Sub LIMITDATAENTRY
forms = ThisComponent.DrawPage.Forms.getByName("MainForm")
comboboxColor = forms.getByName("comboboxColor")
comboboxText = comboboxColor.Text
if comboboxText <> values on column color
then let the user add the value
else error message duplicate value
end if
end sub