473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Prevent a record being saved?

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
11 4806
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
<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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hi I have created asp pages to submit logs online. It is used generally to log from handset similar to iPAQ, Pocket PC. I have on html form and one submit button. On pressing submit , it...
6
by: Miguelito Bain | last post by:
hi everybody- i have a form with 2 fields on it that i want the user to fill out before he or she can save the record, close the record, or move to the next record, etc... here's the code i...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
3
by: Tom | last post by:
Say a form has a subform, a button that pops up a message box and a cancel button. Q1. If data is entered in one or more fields on the main form and the user then clicks the button that opens the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
1
by: deko | last post by:
When I open a bound form like this: DoCmd.OpenForm "frmNotes", , , , acFormAdd and the user runs the Spell Checker on a field in the form, the Spell Checker automatically cycles the form to...
6
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger",...
7
by: Michiel Rapati-Kekkonen | last post by:
Hi, I would like my record to be saved only when my own close button (with all it's checks) is used. I made the winodws close button disappear, but you still can close using the right mouse...
2
by: ruzaika | last post by:
Hey all, I have a table name JobDescription. In it i have my PK as JobId, which I have set as a auto increment. I created a form based on that table. I have disable record navigators and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.