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

Prevent a record being saved?

P: n/a
Hello there! I'm Still pretty new to access only been using it for a
couple of days.

If a record has been partially filled out or even completly filled out
and then the form is closed or the user clicks to view an alternative
record i do not want the values they had typed into that record to be
saved.

I only want the valuse to be saved if the user clicks my save button on
my page.

On my form i have set the control source of each of my textboxes to the
relavent colmn in the table but i dont want these to update the table
untill save is selected.

Is this possible? If not could i do an if statment which said something
like..

If any of the textboxes have not been filled out.
Delete this record altogether

Many thanks in advance

Nov 13 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
si************@gmail.com wrote:
[snip]
If a record has been partially filled out or even completly filled out
and then the form is closed or the user clicks to view an alternative
record i do not want the values they had typed into that record to be
saved.

I only want the valuse to be saved if the user clicks my save button
on my page.

[snip]

I don't understand why you would want to do such a thing, but use an unbound
form if this is the behavior you want.

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

P: n/a
<si************@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hello there! I'm Still pretty new to access only been using it for a
couple of days.

If a record has been partially filled out or even completly filled out
and then the form is closed or the user clicks to view an alternative
record i do not want the values they had typed into that record to be
saved.

I only want the valuse to be saved if the user clicks my save button on
my page.

On my form i have set the control source of each of my textboxes to the
relavent colmn in the table but i dont want these to update the table
untill save is selected.

Is this possible? If not could i do an if statment which said something
like..

If any of the textboxes have not been filled out.
Delete this record altogether

Many thanks in advance

Rather than focussing on the front-end coding, you should be looking at the
back-end table design. That is, if you do not allow null values or
zero-length strings in the field then you cannot save the record unless you
have filled in the required fields. This is a much more robust way to
prevent 'blanks' than any forms/coding you might come up with.
Nov 13 '05 #3

P: n/a
True but if you set a textbox to compulsory and a user clicks to go to
previous form they cant untill they have fill ou the text box the
focus is currently set to.

Nov 13 '05 #4

P: n/a
I want to do this beacause If you only fill out just one text box you
can click go to next record. so someone could create hundreds of
records without fully completing any of them. And i dont want to set
each field to be compulsory because once you click in a textbox you
have to complete it or you cant navigate to anyother part of the form.

Nov 13 '05 #5

P: n/a
I want to do this because i want to log the username, date and a unique
number when the record is stored. If records can be stored without them
being completed then it will cause problems.

Nov 13 '05 #6

P: n/a
si************@gmail.com wrote:
I want to do this beacause If you only fill out just one text box you
can click go to next record. so someone could create hundreds of
records without fully completing any of them. And i dont want to set
each field to be compulsory because once you click in a textbox you
have to complete it or you cant navigate to anyother part of the form.


Then design your tables with proper required fields and validation rules.
You do not have to adopt a "thin client" interface to achieve proper data
integrity. In addition you can do all sorts of validation in the
BeforeUpdate event of the form and disallow the save in that event if there
is anything about the record you don't like.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #7

P: n/a
si************@gmail.com wrote:
I want to do this because i want to log the username, date and a
unique number when the record is stored. If records can be stored
without them being completed then it will cause problems.


All of that can be handled by defaults and/or with code in the BeforeUpdate
event of the form.

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

P: n/a
si************@gmail.com wrote:
True but if you set a textbox to compulsory and a user clicks to go to
previous form they cant untill they have fill ou the text box the
focus is currently set to.


And the problem with that would be...?

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

P: n/a
Right thanks didnt know it was before update.

Sorry started this the other day and never programed in VB in Access
before so totally learning on the fly.

Thankyou

Nov 13 '05 #10

P: n/a
My problem with that are that people who are going to use this database
dont like computers.

I want it be as error free as possible. A record that has only
partially stored info would confuse people.

Nov 13 '05 #11

P: n/a
si************@gmail.com wrote:
My problem with that are that people who are going to use this
database dont like computers.

I want it be as error free as possible. A record that has only
partially stored info would confuse people.


But it would be better to have the application indicate what is wrong with
the record rather than just silently discarding it wouldn't it? Your users
will complain that "Your database is broken. I type stuff in and then when
I go back to look for it again it is not there."
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.