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  

Save n Refresh New Form



 
 
Thread Tools Display Modes
  #1  
Old March 26th, 2007, 08:49 AM posted to microsoft.public.access.forms
Vesta via AccessMonster.com
external usenet poster
 
Posts: 2
Default Save n Refresh New Form

Hi All,

I have use the 'Save' command button in the access2000.
However, I need additional function when I click the 'Save' button.
Click 'Save' -
'Yes' -- Save the data
and then refresh into new form with the Log Number(Primary
Key) increase to the next number
No issue on the 'No' function.
Pls help.
Thank you.

Private Sub SaveData_Click()
On Error GoTo Err_SaveData_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_SaveData_Click:

Exit Sub

Err_SaveData_Click:
MsgBox Err.Description
Resume Exit_SaveData_Click

End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #2  
Old March 26th, 2007, 06:10 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Save n Refresh New Form

On Mon, 26 Mar 2007 07:49:42 GMT, "Vesta via AccessMonster.com" u32018@uwe
wrote:

I have use the 'Save' command button in the access2000.
However, I need additional function when I click the 'Save' button.
Click 'Save' -
'Yes' -- Save the data
and then refresh into new form with the Log Number(Primary
Key) increase to the next number


The Form Wizard is using really old, obsolete toolbar code. There are better
ways!

Try

Private Sub cmdSave_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord acDataForm, Me.Name
End Sub

This assumes that the Log Number is an Autonumber field - if it's not post
back, and explain what you want to happen (in particular what you want to
happen when the user is done entering data!)

No issue on the 'No' function.


I have no idea what you're talking about here.

John W. Vinson [MVP]
 




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


All times are GMT +1. The time now is 06:44 PM.


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