Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

edit, update and cancel command for records on form from a table 1

Status
Not open for further replies.

SwingXH

Technical User
Jun 15, 2004
97
US
I created a form to display my table by using the wizard.
My questions are
1, When click back and next, users can change the records, but I don't want to the user to change the record, unless they hit add new or edit. Of course I can lock the data to prevent any unpurposely change.
2, I have a command to open report. When I hit add new (arrow)and key in the data, looks like I have to click at least once move/next(arrow) to take the change effect, then the change will update in the report. So I think I want to a bottom as Update for the user,but don't know how to make it. Probably a "Cancel" is also wanted.

3, Even the data records got updated, if I already have a open report in preview, hit "preview report" won't update the data in the report unless I close the report first. Is there any way to solve these problems?

Thanks a lot!
SwingXH



 
Hi

You need to lock the controls on the form, or set allowedits property to false

in "edit" button on click, unlock controls or set allowedits=true

to cancel update have a cancel button with docmd.runcommand accmdundo in the on click

to save update have a save button with docmd.runcommand accmdsaverecord in the on click event

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks Ken.
Another question, I want to setup a custemized warning to pop up when I move the record at the end/begin of the records. How to do that?

I remember there's a way when I used VB5 years ago, but I could not find it now in Access using VBA.
Thanks!

SwingXH
 
Hi

Assuming is is a bound form

in the onclick event of the navigation button

Me.recordsetclone.bookmark = me.bookmark
if me.recordsetclone.absoluteposition+1>=me.recordsetclone.recordcount then
msgbox "At last record"
Else
' code to move to last record
end if

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Great, one more question,
I want to one of the main form to show up right after I open the Access file. How to make it?
Thanks a lot!

SwingXH
 
Take a look at the AutoExec macro.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top