Adding data

ca8msm
11-08-2000, 10:40 PM
I am wanting users to be able to add themselves to a database. When I click a button and use:

dtanew.Recordset.AddNew

then the form blanks itself and are able to enter their details and click done (dtanew.UpdateRecord)

Is there anyway of setting the form to be blank at startup cos I tried putting the code in Form_Load and I got an error.

braindead
11-10-2000, 12:05 AM
Hi,

Don't know if this is what you want. But usually this is what I do. Create sub Procedures for ClearForm(), UPDateRec(), AddNewRec()

ClearForm() - Code clears all data in the controls.
UpdateRec() - Validates and writes data into the db
AddNewRec() - Has ClearForm() at the first line with the second line having recordset.addnew

Your form load should only call the ClearForm() and wait for the user to click on an ADD button to call AddNewRec()

Hope you understand what I'm trying to say, coz I know that the explaination is pretty bad.

:)

ca8msm
11-10-2000, 10:05 PM
thanx, along the right lines of what i need, but i am using a normal data environment to retrieve the data. The textboxes are just set to have their datasource as Data1 and their datafield as Field1.

This means that the data is always present at startup and a clear form would simply update the record currently showing to have blank spaces where the data originally was.

Thanks again but I will have to have a re-think about this!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum