Tight Access Forms

  • Thread starter Thread starter Christoph
  • Start date Start date
C

Christoph

Hi,

I received a lot of help on this forum from some MVPs that allowed me
to build a quite sophisticated database. Thank you all for that. I've
deployed it to 5 users and the functions and components work as they
were meant to. I do have two issues though that I can't seem to figure
out:

1. I'm not sure how to put this into words correctly but the entire
"UI" for forms is very loose. What I mean is that if a user pulls up a
form to display data and accidentally changes the value of a field on
the form, the new value gets saved as soon as the user advances to the
next record, closes the form or whatnot. Is there a way to avoid this?
I could see a quick msgbox coming up saying "Hey, you changed data on
this form and you're about to close this record, do you want to save
the changes?". I just would like for the entire form to be a bit
"tighter". Is there a way to do this?

2. I literally tried every setting in the property box but I can't
seem to figure out what I need to change so that when a user hits TAB
in the very last field of the form, no new record will be displayed.
I've had some users add extra records because they hit tab too often,
arrived at a new record, hit a key by accident and that got saved. The
same problem would apply to the ENTER key. Any solution for this?
However, I do want them to use the "Create New Record" button on the
navigation bar.

Thanks so much,
Christoph
 
You can lock forms which have data and only allow editing on new records
(aircode):

Sun Form_Current()
If Me.NewRecord = False Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End Sub

If you just want to slow the user down from creating havoc, set those
properties to No on the property sheet and use a button to over-ride (then
use the Current property to set it back). You can also use the AllowDeletes
property at the same time.
 
Christoph

Look for the "Cycle" property -- you can change it to stay on the same
record when someone tries to <Tab> past the last field. (This is a property
of the Form.)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thank you both so much! Very much appreciated. Already implemented and
works like an ace.

Christoph
 
Christoph said:
1. I'm not sure how to put this into words correctly but the entire
"UI" for forms is very loose. What I mean is that if a user pulls up a
form to display data and accidentally changes the value of a field on
the form, the new value gets saved as soon as the user advances to the
next record, closes the form or whatnot. Is there a way to avoid this?
I could see a quick msgbox coming up saying "Hey, you changed data on
this form and you're about to close this record, do you want to save
the changes?". I just would like for the entire form to be a bit
"tighter". Is there a way to do this?

Occasionally I've locked controls on forms similar to Arvin's
techniques. But usually I just tell the users to watch the triangle
and pencil in the record selector bar on the left hand side of the
form and press cancel if they accidentally make a change.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
I AM LOOKING FOR A TECHERS CENTER TO PUT STUDENT INFO AND MORE LET ME KNOW
MY E-MAIL IS (e-mail address removed) THAKYOU SOSO MUCH
Hilliard City Schools.
 
You can lock forms which have data and only allow editing on new records
(aircode):

Sun Form_Current()
    If Me.NewRecord = False Then
        Me.AllowEdits = False
    Else
        Me.AllowEdits = True
End Sub

If you just want to slow the user down from creating havoc, set those
properties to No on the property sheet and use a button to over-ride (then
use the Current property to set it back). You can also use the AllowDeletes
property at the same time.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com










- Show quoted text -

Sorry to warm this up again but would somebody be able to show me the
code that is needed if I want to pop up a msgbox when the user changes
some data on the form and then tries to go to a different record? I
would like for the user to make the decision if the modified record
should be saved or not.

Thanks again,
Christoph
 
Sorry to warm this up again but would somebody be able to show me the
code that is needed if I want to pop up a msgbox when the user changes
some data on the form and then tries to go to a different record? I
would like for the user to make the decision if the modified record
should be saved or not.

Sure. Use the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns as Integer
iAns = MsgBox("Ready to save record and go to a new one?", vbYesNo)
If iAns = vbNo Then
Cancel = True
End If
End Sub

Do note however - this kind of feature will rather rapidly annoy your users.
"Yes, dammit, of course I want to save the record and go on to a new one,
that's why I entered it!"; and they'll get in the habit of just reflexively
clicking Yes without thinking, and you'll be no better off.

I would suggest instead using the BeforeUpdate event to do some sort of
validity checking - are required fields filled in? are the values reasonable?
- and cancelling only if there is a problem.
 
Sure. Use the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns as Integer
iAns = MsgBox("Ready to save record and go to a new one?", vbYesNo)
If iAns = vbNo Then
   Cancel = True
End If
End Sub

Do note however - this kind of feature will rather rapidly annoy your users.
"Yes, dammit, of course I want to save the record and go on to a new one,
that's why I entered it!"; and they'll get in the habit of just reflexively
clicking Yes without thinking, and you'll be no better off.

I would suggest instead using the BeforeUpdate event to do some sort of
validity checking - are required fields filled in? are the values reasonable?
- and cancelling only if there is a problem.

Thank you very much, John. Unfortunately, I am dealing with a group of
complete computer illiterates. I'd rather get them annoyed than
accidentally changing records in the db which they have done plenty of
times before. This way, at least they catch it themselves if they made
a change.

Thank you again,
Christoph
 
I suspect John's point was more to the notion that your users may get in the
habit of answering <click> when presented with a messagebox. If your users
are relatively naive, you most certainly do NOT want them just saying "yes"
to everything.

As I suspect you are finding, making it "easy" is HARD!

Regards

Jeff Boyce
Microsoft Office/Access MVP

Sure. Use the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns as Integer
iAns = MsgBox("Ready to save record and go to a new one?", vbYesNo)
If iAns = vbNo Then
Cancel = True
End If
End Sub

Do note however - this kind of feature will rather rapidly annoy your
users.
"Yes, dammit, of course I want to save the record and go on to a new one,
that's why I entered it!"; and they'll get in the habit of just
reflexively
clicking Yes without thinking, and you'll be no better off.

I would suggest instead using the BeforeUpdate event to do some sort of
validity checking - are required fields filled in? are the values
reasonable?
- and cancelling only if there is a problem.

Thank you very much, John. Unfortunately, I am dealing with a group of
complete computer illiterates. I'd rather get them annoyed than
accidentally changing records in the db which they have done plenty of
times before. This way, at least they catch it themselves if they made
a change.

Thank you again,
Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top