Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

bound form and updates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
85ascMcLaren - 11 Feb 2008 21:43 GMT
I normally use access like VB and use unbound forms, however I am in a
situation where it would be real quick and dirty to create a bound form for
my application.  I need someone to explain something to me.  I don't
understand the use of the command button for saving a record when everytime I
change anything on a field in a bound form, it is instantly updated in the
database which is what I DO NOT want.  How can I make it so the user has to
click on the save button to save the record without the fields automatically
getting updated in the database while using the bound form....

  Thanks,
     Jason
Graham R Seach - 11 Feb 2008 22:11 GMT
Jason,

Yes, that's true; Access creates/updates a record whenever you close the
form or navigate to another record (assuming all pre-conditions exist).

To prevent that, you must disable the Close button (the CloseButton
property), disable auto navigation (the NavigationButtons property), and
then provide your own Close button and navigation buttons (if you use them).
Then write code to check the form's Dirty property, and if dirty, confirm
whether the user wants to create/update the record or Undo/Cancel it.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

>I normally use access like VB and use unbound forms, however I am in a
> situation where it would be real quick and dirty to create a bound form
[quoted text clipped - 11 lines]
>   Thanks,
>      Jason
85ascMcLaren - 12 Feb 2008 00:01 GMT
You mention that it updates when you close the form or move to the next
record, but it is updating on me even when I just move to another field in
the same record.  I wouldn't mind if it updates on the next record or on a
close, but on each field is a little ridiculous.  Am I not seeing something
correct here....?

  Thanks,
     Jason

> Jason,
>
[quoted text clipped - 27 lines]
> >   Thanks,
> >      Jason
Rick Brandt - 12 Feb 2008 00:10 GMT
> You mention that it updates when you close the form or move to the
> next record, but it is updating on me even when I just move to
> another field in the same record.  I wouldn't mind if it updates on
> the next record or on a close, but on each field is a little
> ridiculous.  Am I not seeing something correct here....?

Either a) what you think is happening is not happening or b) you have writteen
code or macros to make it happen.

By default, there is nothing about an Access form that would commit the record
every time you change fields.  In fact on many forms that would cause an error
because some required fields hadn't been populated yet.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

85ascMcLaren - 12 Feb 2008 01:10 GMT
You are probably correct.  I think I have a combo box controlling the display
of the records, so when you choose another combo box field, it is like moving
to another record which automatically updates the record.  What can I do to
stop the update if the user selects another selection from the combo list ?  
Something in the Form's dirty property maybe ?

  Thanks,
     Jason

> > You mention that it updates when you close the form or move to the
> > next record, but it is updating on me even when I just move to
[quoted text clipped - 8 lines]
> every time you change fields.  In fact on many forms that would cause an error
> because some required fields hadn't been populated yet.
Rick Brandt - 12 Feb 2008 12:23 GMT
> You are probably correct.  I think I have a combo box controlling the
> display of the records, so when you choose another combo box field,
> it is like moving to another record which automatically updates the
> record.  What can I do to stop the update if the user selects another
> selection from the combo list ? Something in the Form's dirty
> property maybe ?

Exactly how is it "controlling the display of records"?  If you have added a
ComboBox that navigates the form then it is not "like moving to another
recoord".  It IS moving to another record.  The user should not mess with that
control until moving to a different record is what they want to have happen.
This is no different than entering some data and then pressing one of the
navigation buttons.  The user simply has to know how the form works and do
things correctly.

Have you clearly indicated that the ComboBox is for navigating and not for data
entry?  ComboBoxes used for navigating should not be bound to any field.  Is
yours unbound?

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Graham R Seach - 12 Feb 2008 01:07 GMT
Jason,

In addition to what Rick has said, if you have the primary key field visible
(and it is an Autonumber type), it may appear that the record has been saved
because you'll see the number that has been reserved for it. But as soon as
you start editing a record, a transaction is opened for it; the record will
not be saved until you close the form, move to another record, or move to a
subform.

Is it possible that the other "field" is actually sitting on a subform?

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

> You mention that it updates when you close the form or move to the next
> record, but it is updating on me even when I just move to another field in
[quoted text clipped - 40 lines]
>> >   Thanks,
>> >      Jason
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.