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  

Newbi needs a very small help, thank you very much.



 
 
Thread Tools Display Modes
  #1  
Old August 1st, 2007, 09:14 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 4
Default Newbi needs a very small help, thank you very much.



Newbi needs a very small help, thank you very much.


Hello everyone and thank you very much for your time.

I Have a small db for invoicing and on my form (with a subform) there
is a CANCEL button which will just cancel what had been selected or
entered in the form ... here is the code behind the cancel button...


Private Sub Cancel_Click()

Me![BillsFormSub].Form.Refresh

DoCmd.SetWarnings False

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

DoCmd.SetWarnings True


Exit_Cancel_Click:
Exit Sub
End Sub


This was working fine for many years until just recently where I
upgraded to Windows XP with SP3 Off XP 2003 and the Access 2002
format. (from Off97)

And now everytime someone clicks the cancel button, I get an error
3021 code, and my bill goes up by one bill number.

I would very much appriciate if you could give me and example of a
code replacement for this cancel action that would work in my case.

Sincerely yours,

Mohammad Reza.



P.s in the meantime I have replaced the above two lines with:

DoCmd.RunCommand acCmdDeleteRecord

and it seems it will delete the record as I want it with no error
messege, but now the problem is that the form is advancing to a new
record even thought the current one is also empty.

If I close and reopen the form though, everything is fine.

I tried pressing ESC twice, and using all sorts of DIRTY UNDO REFRESH
and REQUERY commands all to no use, the only way now to get to the
last record is to close and reopen the form, any ideas?

 




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 01:41 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.