save record code??????

Kieran

Learn learn learn..Forget
Local time
Today, 09:41
Joined
Jul 16, 2002
Messages
23
i need a command for a macro that will save the record i'm working on from a form. i have an older database which has this code =rECsAVE() but i tried it and it doesn't work. if any one knows any command for access xp that will save a record from a macro please help me...........

regards,
Kieran
 
It is way easier in a code module where you can specify exactly what it is you are saving.

In a macro, you can use Save and then specify the object type (ie: form) and the object name (ie: frmMyForm). This actually saves the form itself but will force the changes to be saved.

You can also use Refresh in a macro line and specify the control you want refreshed. This would be better. If you are trying to save the record so that it will get automatically assigned an ID number you could use this.

You can also use Requery, which will definately save your record but can lose your spot in the recordset as it basically rebuilds the recordsource for your form.

Hope that helps.
 
refresh??

so do u mean in the macro set 'runcode' to 'refresh' ??

or is it a seperate macro command??
 
Nope. Go into the macro edit-window and add a line that says "Refresh".

If you use "RunCode" you are asking Access to run a routine from a code module.

"Refresh" is a separate macro line.
 
Since you're using a macro, use the SaveRecord option, from the run command list
 
thanks

thanks for the help, i have now fixed the problem......,
 

Users who are viewing this thread

Back
Top Bottom