PC Review


Reply
Thread Tools Rate Thread

Access 2000 mdb and an option box for saving record

 
 
Rob S
Guest
Posts: n/a
 
      1st Sep 2004

Hi,

Firstly I'm a complete Access novice.

We have inherited a Access 2000 mdb with various names and addresses stored,
which we access through a form. I can let either everyone or no-one update the
database with file permissions, but what I want to be able to do is let everyone
make amendments, but have a Yes/No dialogue as they leave the record/quit the
database so they can save or discard their amendments to that record. Or failing
that an "update mode" button on the form which changes just that record from
read only to read/write.

This surely isn't that complicated, but we've struggled all afternoon on it. So
far we have come up with a macro associated with the BeforeUpdate event, which
pops up a warning MsgBox, but can't see anywhere to have a Yes/No box. Would we
need to get into VB for something as simple as this?

regards

-Rob
robatwork at mail dot com
 
Reply With Quote
 
 
 
 
Neil Ginsberg
Guest
Posts: n/a
 
      1st Sep 2004
In your form design view, go to the properties window, and, in the Event
tab, select [Event Procedure] for BeforeUpdate (make sure that the
properties window says "Form" in the title bar, so that you're modifing the
properties for the form). With the cursor in the BeforeUpdate line of the
properties window, click the ellipsis next to [Event Procedure]. You should
be brought into a window that looks something like this:

Private Sub Form_BeforeUpdate(Cancel As Integer)


End Sub

Somewhere between the "Private Sub" and "End Sub" lines, insert the
following so that the window now looks like:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If MsgBox("Save changes made to this record?",
vbQuestion+vbYesNo)=vbNo then
Cancel = True
End If

End Sub

That should take care of it.

Neil


"Rob S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hi,
>
> Firstly I'm a complete Access novice.
>
> We have inherited a Access 2000 mdb with various names and addresses
> stored,
> which we access through a form. I can let either everyone or no-one update
> the
> database with file permissions, but what I want to be able to do is let
> everyone
> make amendments, but have a Yes/No dialogue as they leave the record/quit
> the
> database so they can save or discard their amendments to that record. Or
> failing
> that an "update mode" button on the form which changes just that record
> from
> read only to read/write.
>
> This surely isn't that complicated, but we've struggled all afternoon on
> it. So
> far we have come up with a macro associated with the BeforeUpdate event,
> which
> pops up a warning MsgBox, but can't see anywhere to have a Yes/No box.
> Would we
> need to get into VB for something as simple as this?
>
> regards
>
> -Rob
> robatwork at mail dot com



 
Reply With Quote
 
Rob S
Guest
Posts: n/a
 
      2nd Sep 2004
On Wed, 01 Sep 2004 16:11:28 GMT, "Neil Ginsberg" <(E-Mail Removed)> wrote:

- If MsgBox("Save changes made to this record?",
-vbQuestion+vbYesNo)=vbNo then
- Cancel = True
- End If

Excellent Neil - just the trick. We amended it to do a form.Undo if the answer
was no, but many thanks for setting us on the right lines.

regards


-Rob
robatwork at mail dot com
 
Reply With Quote
 
Neil Ginsberg
Guest
Posts: n/a
 
      8th Sep 2004
No problem. Glad it worked out for you.

Neil

"Rob S" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 01 Sep 2004 16:11:28 GMT, "Neil Ginsberg" <(E-Mail Removed)>
> wrote:
>
> - If MsgBox("Save changes made to this record?",
> -vbQuestion+vbYesNo)=vbNo then
> - Cancel = True
> - End If
>
> Excellent Neil - just the trick. We amended it to do a form.Undo if the
> answer
> was no, but many thanks for setting us on the right lines.
>
> regards
>
>
> -Rob
> robatwork at mail dot com



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: adding a new record and saving it, moving to next, previous record using a form in Access 2007 John W. Vinson Microsoft Access 1 24th Jun 2010 10:03 PM
Saving Record using Access FE to SQL BE Blane via AccessMonster.com Microsoft Access Form Coding 1 22nd Aug 2007 09:38 PM
Access 2003; Create form Yes/No option for saving changes. =?Utf-8?B?R2FsbGlmcmV5?= Microsoft Access Forms 1 16th May 2006 02:32 AM
Access 2000 - Hidden record counter and open to new record Kostika Microsoft Access Getting Started 5 23rd Aug 2004 12:38 PM
Saving a new record in a form in Access 2000 pvp Microsoft Access Form Coding 2 11th Feb 2004 03:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.