Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form to add record 3

Status
Not open for further replies.

JavaToPerlNowVB

Programmer
Joined
Jul 14, 2005
Messages
84
Location
US
I want to create a form to add record to a table only if that record is not in the table, Can I do this in access.
thanks
 
Make sure you set the id field to be Indexed-No Duplicates in the table design.
 
HOw should i connect the form to write data to the table, I have done this using HTML form with perl doing the sql insert but have no idea how to do it in Access
thanks
 
Just ensure the correct indices (single column and/or multicolumn) are set in the table, bind the form to the table (or through a query) - and voila - Access should start throwing uggly messages at you when you try to save a record with dupes ;-) (you can substitute those messages through the form error event, or better, validate yourself in the forms before update event).

Roy-Vidar
 
HOw should i connect the form to write data to the table
Have a look at the RecordSource property of the form object, ie have a BOUND form.
only if that record is not in the table
Have a look at the DLookUp function you can use in the BeforeUpdate event procedure of the control bound to the PrimaryKey field.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top