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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Basic Tables Question



 
 
Thread Tools Display Modes
  #1  
Old February 27th, 2006, 03:32 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or cancel,
which is certainly standard in Excel and Word. Is this by design? If so,
is there any way to make it prompt? It seems it might be a problem if I
change a record by mistake.

Thanks.

Chuck


  #2  
Old February 27th, 2006, 04:04 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

This is by design. As each record is edited it is posted back to the
database. The developer can build a prompt when the 'onupdate' event fires
and/or can add appropriate field validation values to the application.
However, these should be used in a manner to make sure the user experience
is still appropriate.


Ed Warren.

"Chuck Hildebrandt" wrote in message
m...
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or
cancel, which is certainly standard in Excel and Word. Is this by design?
If so, is there any way to make it prompt? It seems it might be a problem
if I change a record by mistake.

Thanks.

Chuck



  #3  
Old February 27th, 2006, 04:19 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

"Chuck Hildebrandt" wrote in message
m...
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or
cancel, which is certainly standard in Excel and Word. Is this by design?
If so, is there any way to make it prompt? It seems it might be a problem
if I change a record by mistake.


That's the was Access is. What I do is to create a form used for Add mode
only with all unbound fields then when an update button is pressed, I add
the
contents of the fields to the table. If the Cancel button is pressed
no update occurs. It's more work but it is a lot safer.

Tom Lake


  #4  
Old February 27th, 2006, 04:52 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

That's the BeforeUpdate event, not onupdate. The BeforeUpdate event should
be cancelled if any errors are detected or if you prompt the user and he
says not to save. Use:

Cancel = True

to cancel the BeforeUpdate event. You can use .SetFocus to set focus back
to a control that needs correcting and you can use MsgBox to display
messages. For example:

Private Sub Form_BeforeUpdate (Cancel As Integer)
If IsNull(Me.SomeField) Then
MsgBox "Some Field may not be null", vbOKOnly
Cancel = True
Me.SomeField.SetFocus
End If
If Me.SomeDate Date() + 7 Then
MsgBox "Some Date must not be more than one week in the future",
vbOKOnly
Cancel = True
Me.SomeDate.SetFocus
End If
End Sub

"Ed Warren" wrote in message
...
This is by design. As each record is edited it is posted back to the
database. The developer can build a prompt when the 'onupdate' event
fires and/or can add appropriate field validation values to the
application. However, these should be used in a manner to make sure the
user experience is still appropriate.


Ed Warren.

"Chuck Hildebrandt" wrote in message
m...
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or
cancel, which is certainly standard in Excel and Word. Is this by design?
If so, is there any way to make it prompt? It seems it might be a problem
if I change a record by mistake.

Thanks.

Chuck





  #5  
Old February 27th, 2006, 04:54 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

There is no need to go through all that work. All you need to do is
understand how to use the form's BeforeUpdate event properly to have
COMPLETE control over whether or not a record gets saved.

"Tom Lake" wrote in message
...
"Chuck Hildebrandt" wrote in message
m...
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or
cancel, which is certainly standard in Excel and Word. Is this by design?
If so, is there any way to make it prompt? It seems it might be a problem
if I change a record by mistake.


That's the was Access is. What I do is to create a form used for Add mode
only with all unbound fields then when an update button is pressed, I add
the
contents of the fields to the table. If the Cancel button is pressed
no update occurs. It's more work but it is a lot safer.

Tom Lake



  #6  
Old February 27th, 2006, 01:37 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Basic Tables Question

Of course you are correct, thanks

Ed Warren

"Pat Hartman(MVP)" wrote in message
...
That's the BeforeUpdate event, not onupdate. The BeforeUpdate event
should be cancelled if any errors are detected or if you prompt the user
and he says not to save. Use:

Cancel = True

to cancel the BeforeUpdate event. You can use .SetFocus to set focus back
to a control that needs correcting and you can use MsgBox to display
messages. For example:

Private Sub Form_BeforeUpdate (Cancel As Integer)
If IsNull(Me.SomeField) Then
MsgBox "Some Field may not be null", vbOKOnly
Cancel = True
Me.SomeField.SetFocus
End If
If Me.SomeDate Date() + 7 Then
MsgBox "Some Date must not be more than one week in the future",
vbOKOnly
Cancel = True
Me.SomeDate.SetFocus
End If
End Sub

"Ed Warren" wrote in message
...
This is by design. As each record is edited it is posted back to the
database. The developer can build a prompt when the 'onupdate' event
fires and/or can add appropriate field validation values to the
application. However, these should be used in a manner to make sure the
user experience is still appropriate.


Ed Warren.

"Chuck Hildebrandt" wrote in message
m...
I have Access 2003. It seems when I change a record, and go to close the
sheet, there is no prompt asking me if I want to save the changes or
cancel, which is certainly standard in Excel and Word. Is this by
design? If so, is there any way to make it prompt? It seems it might be
a problem if I change a record by mistake.

Thanks.

Chuck







 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
random sort my table ADAM Running & Setting Up Queries 5 December 30th, 2005 06:59 AM
Basic Question for Lookups. Bernard Piette Database Design 9 December 19th, 2005 12:32 AM
Basic Beginner Question: Reverse engineering A97 database [email protected] Visio 1 October 22nd, 2005 03:55 PM
Question about compacting and linked tables Chris Ennis General Discussion 1 May 24th, 2005 03:15 PM
Basic table structure question Mattymoo New Users 6 November 12th, 2004 01:47 PM


All times are GMT +1. The time now is 05:49 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.