write record problem

AccessFreak

Registered User.
Local time
Today, 23:45
Joined
Feb 19, 2009
Messages
69
I have a form with 2 buttons, "add application" and "delete application".

its a empty form. There is no option to scroll to other records. The form is just for adding new applications.

This is the problem: When I write a new record it's automatically saving the data. I don't want that. It needs to remember it with help of the memory and then by clicking the "add application"-button, it needs to save the record. The delete application-button needs to be a cancelbutton. If something wrote down, it just needs to clear it, no delete event. Also when trying to avoid the adding form after write down a new record without saving it, It may not be saved. Only when clicking the save button.

So can someone help me with this. Thank you
 
That's the major disadvantage of bound forms. Especially if you use an autonumber field.
A simple solution to your problem is to use an unbound form.

HTH:D
 
If you want to isolate input data before writing it to underlying tables then use unbound controls to capture user input and either open a recordset in code to append or update records or use execute statement to write to the table. For example, consider a parameter table with fields Param1 (text) and Param2 (numneric) in a single record: Put 2 unbound text boxes on a form with any name you choose (Param1 and Param2 would be good) then use the following code to write user input to the table when a button is clicked.

Dim dbs As Database
Set dbs = CurrentDb
dbs.Execute "Update ParameterTable Set Param1='" & me.Param1.value & "', Param2 =" & me.Param2.value

or use a recordset to do the same or perhaps add a record...
Dim dbs As Database
Dim ParamTable As DAO.Recordset
Set dbs = CurrentDb
Set ParamTable = dbs.OpenRecordset("ParameterTable")
ParamTable.addnew
ParamTable("Param1")=me.Param1.value
ParamTable("Param2")=me.Param2.value
ParamTable.update

A bit late but hope this helps.
 

Users who are viewing this thread

Back
Top Bottom