to check if the gallery name exists in the database:
1) Create a new recordset. Set it to use the gallery table, and filter the gallery name column on the gallery name form element.
2) Add server Validation form CSS Form builder. Use Number validation. For the server variable enter:
where <RecordsetName> is the name of the recordset.
set the minimum nuber to -1 and the maximum to 0.
this will cause validation to fail if the gallery name is found in the database.