A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Saving a record in the Form



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2004, 11:11 AM
Dan
external usenet poster
 
Posts: n/a
Default 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  
Old August 19th, 2004, 11:43 AM
external usenet poster
 
Posts: n/a
Default


-----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  
Old August 19th, 2004, 11:45 AM
SJ McAbney
external usenet poster
 
Posts: n/a
Default

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  
Old August 19th, 2004, 11:49 AM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default

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  
Old August 19th, 2004, 11:52 AM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.