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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|