If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Saving a record in the Form
Hi ,
beginner here. Am currently designing an user-input form. For Access , it will save / update the table after you finish the last input cell (i.e tab all fields). however, I would like to disable this function and create a button "SAVE" only when this button is clicked , will the record be save/updated into the table any ideas how to do that ? |
#2
|
|||
|
|||
-----Original Message----- I would like to disable this function and create a button "SAVE" only when this button is clicked , will the record be save/updated into the table On the click event of the button (called cmdSave) Private Sub cmdSave_Click() If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord End If End Sub |
#3
|
|||
|
|||
I forgot to add that you can maybe have the button's
Enabled property initially set to False and Enabled the button only when the current record is made 'Dirty' i.e. Private Sub Form_Dirty() Me.cmdSave.Enabled = True End Sub |
#4
|
|||
|
|||
Yes, unbind your form from the data and create a recordset to fill the form.
Then, after editing you can create another recordset to write the data back to the table. Alternatively, you can use a temporary local table to read and write the data. None of this is beginner's work, so you may want to simply train your users to use the Escape key (twice) to discard the current record you are creating. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access "Dan" wrote in message ... Hi , beginner here. Am currently designing an user-input form. For Access , it will save / update the table after you finish the last input cell (i.e tab all fields). however, I would like to disable this function and create a button "SAVE" only when this button is clicked , will the record be save/updated into the table any ideas how to do that ? |
#5
|
|||
|
|||
While this will explicitly save the record, it will not discard any records.
You'll need to delete or undo the current record if you don't want it saved automatically. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access wrote in message ... -----Original Message----- I would like to disable this function and create a button "SAVE" only when this button is clicked , will the record be save/updated into the table On the click event of the button (called cmdSave) Private Sub cmdSave_Click() If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord End If End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Form in Edit Mode | JN | Using Forms | 0 | July 12th, 2004 05:47 PM |
Open form to blank record | Deb Smith | Using Forms | 1 | July 10th, 2004 03:46 PM |
Can't update table from Form | sara | Using Forms | 3 | June 11th, 2004 02:12 PM |
Help with Pop Up Form | Sandra | Using Forms | 2 | May 31st, 2004 01:55 PM |
Error saving record on a form | Adam | Using Forms | 0 | May 27th, 2004 09:41 PM |