473,770 Members | 4,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

saving records

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.c om
http://www.accessmonster.com/Uwe/For...ccess/200511/1
Nov 16 '05 #1
11 2856
"ka******@comca st.net via AccessMonster.c om" <u15580@uwe> wrote in message
news:576c92296b 074@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
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_Cli ck()
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
automaticall y 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.c om
http://www.accessmonster.com/Uwe/For...ccess/200511/1
Nov 16 '05 #3
ka******@comcas t.net via AccessMonster.c om 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_Cli ck()
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_Cli ck()
DoCmd.RunComman d 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
"Rick Brandt" <ri*********@ho tmail.com> wrote in
news:Wq******** **********@news svr11.news.prod igy.com:
Private Sub cmdfinished_Cli ck()
DoCmd.RunComman d 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
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_Cli ck()
DoCmd.RunComman d acCmdSaveRecord
DoCmd.Close acForm, "contact sheet form"
End Sub


--
Message posted via http://www.accessmonster.com
Nov 18 '05 #6
ka******@comcas t.net via AccessMonster.c om 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
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
"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
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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1728
by: Jack | last post by:
Hi, I need to build a asp page where it would serve as a data entry record page as well as display page for records saved. This page should also allow editing of records that has been saved. e.g. SAVEBUTTON SS# EntryBox Name EntryBox Date EntryBox Revenue Generated EntryBox
3
8577
by: CSDunn | last post by:
Hello, I have an Access 2000 Project in which the data comes from a SQL Server 2000 database, and multiple users need to be able to see new records as each user adds records. The users also need to be aware of updates as they are made to current records. The data the users are looking at is presented in a subform that has the Default View property set to 'Single Form'. In order for each user to see the update to the current record as...
1
1903
by: Cillies | last post by:
Hello all, I was recently browsing the forum and remembered seeing a message relating to MS Access Bugs/Flaws. The thing is I cannot find that thread anymore, and so was wondering does anyone know if MS Access (97-2000) has a bug in it where the user thinks the application is saving a record where in fact the record has not been saved. The reason I am asking is that this problem has now arrisen with a DB I have built, where the end user...
13
7409
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
1
1436
by: G Uljee | last post by:
Hi, I've an application with an Access database (max 10000 records). I want to save per 1000 records at once into the Access database, witch option do you prefer (example)? Someone experience with saving bulk data?
4
10819
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a DataTable to session vs saving a custom object of the same data.
1
3237
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working with. If a user enters data in a subform, then directly clicks the command button on the parent form, the data in the subform is not included in their document. I THOUGHT that as soon as focus left the subform, any pending changes to the data...
3
2561
by: Andy_Khosravi | last post by:
I'm having a problem with an entry form on one of my applications. It would appear that the save action is sometimes not working, and is generating no error when it fails. I'm hoping one of you may have some insight into what is causing the problem. I'll describe only the general outline since the actual code is several pages long. 1. Entry form opened in Data Entry mode 2. Global variable SaveRec set to False on form load.
2
1573
by: darrel | last post by:
Hi there vb masters i have a problem regrading the saving procedure in my program: Here my code: Private Sub cmdSave_Click() Dim rsShowRec As New ADODB.Recordset Dim cnn As New ADODB.Connection Set cnn = New ADODB.Connection
0
9439
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.