By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

saving records

P: n/a
i have a form that records 9 fields into a table. on that form i have a
'done' button to close the form. right now, if the form is fully filled in,
but you don't press 'enter' before you click 'done', then it closes the form
without saving the record. can i change this? thanks.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200511/1
Nov 16 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
"ka******@comcast.net via AccessMonster.com" <u15580@uwe> wrote in message
news:576c92296b074@uwe...
i have a form that records 9 fields into a table. on that form i have a
'done' button to close the form. right now, if the form is fully filled in,
but you don't press 'enter' before you click 'done', then it closes the form
without saving the record. can i change this? thanks.


You're leaving out a key piece of information because by default Access
automatically saves when you close a form or move to another record. In fact
you have to go out of your way to stop Access from saving the record.

The exception to this is if you have a custom close button and use it to close a
from where a record is partially filled out but where at least one required
field is not filled in. In that case the partial record is silently discarded.

While that sounds like what you are seeing it would not happen if you are
filling out all required fields.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 16 '05 #2

P: n/a
your exception scenario is EXACTLY what i have. nice job. i'm thinking of a
person using this form and not filling everything in properly (by mistake)
and closing the form and not actually recording the information. they'd
never go back and check so i have to make sure that this doesn't happen.
right now, all i have on this command button is this:

Private Sub cmdfinished_Click()
DoCmd.Close acForm, "contact sheet form", acSaveYes
End Sub

i don't know vba so i don't know how to fix it. can you tell me how to
change it so there is some kind of if statement that will check to see if all
required fields are filled in before closing the form, and if not, cancel the
close with a little popup mesage that reads "you must fill in all required
fields before closing the form"?

thanks.
Rick Brandt wrote:
i have a form that records 9 fields into a table. on that form i have a
'done' button to close the form. right now, if the form is fully filled in,
but you don't press 'enter' before you click 'done', then it closes the form
without saving the record. can i change this? thanks.


You're leaving out a key piece of information because by default Access
automatically saves when you close a form or move to another record. In fact
you have to go out of your way to stop Access from saving the record.

The exception to this is if you have a custom close button and use it to close a
from where a record is partially filled out but where at least one required
field is not filled in. In that case the partial record is silently discarded.

While that sounds like what you are seeing it would not happen if you are
filling out all required fields.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200511/1
Nov 16 '05 #3

P: n/a
ka******@comcast.net via AccessMonster.com wrote:
your exception scenario is EXACTLY what i have. nice job. i'm
thinking of a person using this form and not filling everything in
properly (by mistake) and closing the form and not actually recording
the information. they'd never go back and check so i have to make
sure that this doesn't happen. right now, all i have on this command
button is this:

Private Sub cmdfinished_Click()
DoCmd.Close acForm, "contact sheet form", acSaveYes
End Sub


Just issue a a save to the record before you issue the close command. The
save will protest about the missing fields. The acSaveYes you have now is
actually for saving design changes to the form. It has nothing to do with
saving data.

Private Sub cmdfinished_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "contact sheet form"
End Sub
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 16 '05 #4

P: n/a
"Rick Brandt" <ri*********@hotmail.com> wrote in
news:Wq******************@newssvr11.news.prodigy.c om:
Private Sub cmdfinished_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "contact sheet form"
End Sub


Ne,Dirty = False is always a better choice, as you can't guarantee
that the menu choice will always be available.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 17 '05 #5

P: n/a
this didn't work exactly. when i clicked my done button on an incomplete
record, it prompted a window to enter the debuger or close the form. how can
i get it so it's a little more user-friendly for the final version?

Rick Brandt wrote:
your exception scenario is EXACTLY what i have. nice job. i'm
thinking of a person using this form and not filling everything in

[quoted text clipped - 6 lines]
DoCmd.Close acForm, "contact sheet form", acSaveYes
End Sub


Just issue a a save to the record before you issue the close command. The
save will protest about the missing fields. The acSaveYes you have now is
actually for saving design changes to the form. It has nothing to do with
saving data.

Private Sub cmdfinished_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "contact sheet form"
End Sub


--
Message posted via http://www.accessmonster.com
Nov 18 '05 #6

P: n/a
ka******@comcast.net via AccessMonster.com wrote:
this didn't work exactly. when i clicked my done button on an
incomplete record, it prompted a window to enter the debuger or close
the form. how can i get it so it's a little more user-friendly for
the final version?


Shouldn't do that. What line of code is highlighted if you enter debug?

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 18 '05 #7

P: n/a
Yes.
Remove the button (and any code associated with it).
Let Access do the form/record save management.
After that:
Study Access for 15 years.
Develop for 15 years.
If you come up with a better way than the Access way, contact MS and
suggest that they implement this better way in the next version.
Then:
Wait for the next version.
After that:
Let Access do the form/record save management.

Nov 18 '05 #8

P: n/a
"lylefair" wrote
Remove the button (and any code associated with it).
Let Access do the form/record save management.
After that:
Study Access for 15 years.
Develop for 15 years.
If you come up with a better way than the Access way, contact MS and
suggest that they implement this better way in the next version.
Then:
Wait for the next version.
After that:
Let Access do the form/record save management.


I think, perhaps, you underestimate the experience required to come up with
improvements on Access. There certainly are people within Microsoft who
presumably have adequate background to, are in a position to, and try to,
come up with "better ways", and, arguably, they can't come up with many
_real_ improvements. :-)

Larry Linson
Microsoft Access MVP


Nov 19 '05 #9

P: n/a
Larry Linson wrote:
"lylefair" wrote
> Remove the button (and any code associated with it).
> Let Access do the form/record save management.
> After that:
> Study Access for 15 years.
> Develop for 15 years.
> If you come up with a better way than the Access way, contact MS and
> suggest that they implement this better way in the next version.
> Then:
> Wait for the next version.
> After that:
> Let Access do the form/record save management.


I think, perhaps, you underestimate the experience required to come up with
improvements on Access. There certainly are people within Microsoft who
presumably have adequate background to, are in a position to, and try to,
come up with "better ways", and, arguably, they can't come up with many
_real_ improvements. :-)

Larry Linson
Microsoft Access MVP


I'll take this further off topic. Access is tough to beat but not
because some people at MS can't improve it much (I saw the smiley). I
don't doubt that there are people at Microsoft who can make an
application's code nearly flawless. It's just that they won't let
those people near the software :-). You'd almost think the future
direction of Access was the same way. MS was able to integrate the
internet into the OS. They weren't as successful at integrating the
internet into Access - yet. It would indeed take a lot of
sophistication to replace Access. I hope that MS will get internet
integration with Access right and not have to look over their shoulder
for newcomers. I think Access as a RAD tool for internet development
would be unbeatable. Once the application is sketched out using Access
a decision can be made whether or not to flesh it out using .NET
(ignoring things like optimization of SQL Server for now), hopefully
after applying new painless conversion tools. I want to be able to
create an internet/intranet application almost as easily as I can
create an mdb. Is that asking too much?

James A. Fortune

Nov 20 '05 #10

P: n/a
<ji********@compumarc.com> wrote
. . . I want to be able to
create an internet/intranet application almost as easily as I can
create an mdb. Is that asking too much?


It's not _asking_ too much. Expecting it to happen anytime soon may be
_expecting_ too much. :-)

Larry

Nov 20 '05 #11

P: n/a
Larry Linson wrote:
<ji********@compumarc.com> wrote
> . . . I want to be able to
> create an internet/intranet application almost as easily as I can
> create an mdb. Is that asking too much?


It's not _asking_ too much. Expecting it to happen anytime soon may be
_expecting_ too much. :-)

Larry


Sigh. That's what I expected :-).

James A. Fortune

It's bad when the "haves" realize that they have the power to "have"
even more.

Nov 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.