Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2007

Tip: Looking for answers? Try searching our database.

To Jon Vinson

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aurora - 31 Jan 2007 15:13 GMT
Good Morning - first of all THANK YOU very much for your answer to my
"Stopping an automatic save" question on 1/30/07. (I am making changes to a
Db that I did not create).  Your instructions were very clear and easy to
follow and it works beautifully.
 
Now I want to know if I can do the same thing with a Save Macro/button.  On
the form is a SAVE button that I know everyone is using.  Right now people
will click on the SAVE button and think their work is saved until they try to
get out of the screen or go to another record.  That is when the message
comes up.  Please let me know if this is possible or not?  If it is - how can
I do this?

Again thank you very much for your previous help - Aurora
John Vinson - 31 Jan 2007 17:02 GMT
>Good Morning - first of all THANK YOU very much for your answer to my
>"Stopping an automatic save" question on 1/30/07. (I am making changes to a
[quoted text clipped - 9 lines]
>
>Again thank you very much for your previous help - Aurora

Please open this form in design view, view the properties of this
button, and tell me what is in the button's Click event. If it's a
macro post the steps of the macro; if it shows [Event Procedure] click
the ... button by it and post the VBA code. Since I don't know what
the SAVE button is doing, it's a bit hard to suggest how to fix it!

                 John W. Vinson[MVP]
Aurora - 31 Jan 2007 18:51 GMT
Thank you Jon:  This is what I did.  

Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click
Dim iAns As Integer
iAns = MsgBox("Is this information correct and ready to be saved?", vbYesNo)
If iAns = vbNo Then
Trueline: Me.Undo
Cancel = True
End If

Now I am getting an error.  The "Cancel =" is highlighted in blue.
The error says - "Compile Error.  Can't find project or library."
What do I do now?
Aurora

End Sub

> >Good Morning - first of all THANK YOU very much for your answer to my
> >"Stopping an automatic save" question on 1/30/07. (I am making changes to a
[quoted text clipped - 17 lines]
>
>                   John W. Vinson[MVP]    
Douglas J. Steele - 31 Jan 2007 19:07 GMT
Remove the line

Cancel = True

from your code.

If your code were in a BeforeUpdate event, it would be required. However,
there is no Cancel argument in Click events.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thank you Jon:  This is what I did.
>
[quoted text clipped - 42 lines]
>>
>>                   John W. Vinson[MVP]
John Vinson - 31 Jan 2007 22:58 GMT
>Now I am getting an error.  The "Cancel =" is highlighted in blue.
>The error says - "Compile Error.  Can't find project or library."
>What do I do now?

Put the code in the Form's BeforeUpdate event (which does have a
Cancel argument) rather than in the button's Click event (which
doesn't).

The BeforeUpdate event will fire no matter HOW the user chooses to
save the record - whether from the button, or closing the form, using
the Records menu option, whatever.

Juat a note: having this kind of verification ("do you really want to
save?") gets annoying to users over a rather short time, and ceases to
be effective; users will just blindly click Yes... and THEN realize
"oops I didn't want to do that". Good luck.

                 John W. Vinson[MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.