Check if data exists in database.

G

Guest

Hi!

I’ve a form (F_OE_Ideas_FillIn) with a couple fields where users can put
their data in. After they put their data in, I’ve a submit button witch
select all the data from the fields on this specific form and put it in the
database table (T_OE_Ideas).

What I want:
Is a check if the data is already in the database, if so: ask the user
conform this operation and then continue or stop the action.
If the data is currently not in the database, then put the data into the
table (T_OE_Ideas) without confirmation.

Is this possible?

Kind regards, Stefan van der Hooft.
 
J

John W. Vinson

Hi!

I’ve a form (F_OE_Ideas_FillIn) with a couple fields where users can put
their data in. After they put their data in, I’ve a submit button witch
select all the data from the fields on this specific form and put it in the
database table (T_OE_Ideas).

Why?

Have you consciously and intentionally rejected the very standard
technique of using a bound form? No code needed at all, and you can
put a unique Index on the fields to prevent duplicates.
What I want:
Is a check if the data is already in the database, if so: ask the user
conform this operation and then continue or stop the action.
If the data is currently not in the database, then put the data into the
table (T_OE_Ideas) without confirmation.

Use your command button code; either use DLookUp to look up the record
in the table. If DLookUp returns a NULL result there is no such
record; if it returns data there is. Or, open a Recordset based on
the table using the form control values as criteria.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top