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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Simple Add Form?

Status
Not open for further replies.

Woodman650

Technical User
Jan 20, 2005
92
US
Hey guys,
I think this SHOULD be fairly straight forward, but I'm not entirely sure. I have a button that opens up a form for adding entires to my main table, but when it opens, it is at record 1. I would like the form to automatically open and set to a "new record" or the last, blank record in the database. When a user then hits "add" after entering the data, the form automatically clears the fields and moves to another "new entry" command. Hope that makes sense. It's fairly straight-forward, I'm just not sure how to get the form to automatically go to "new entry" when it opens, and when this "add" button is pressed. thanks!
 
In design view of your form, bring up the property sheet. Click on the square in the upper left hand corner to select the form (you'll see a little black square appear). Click the All tab on the property sheet and set the Data Entry property to YES. Then click on your save button, click on the ONClick event and after the code to save the record type
Form.Requery
 
ohh, excellent! Not too hard at all. Two quick questions:

Is there a way to tell a user that the data has been entered successfully?

Is there a way to check to make sure a duplicate entry does not exist? Say, we are entering info in the field "title", make sure another entry in the table doesn't already have that "title"?

thanks!
 
Have a look at the DLookUp function and the BeforeUpdate event.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
In the table design, on the properties of the "Title" field, set Indexed to 'Yes (No Duplicates)'. This will prevent the addition of records which create duplicate values in that field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top