If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
bound form and updates
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 |
#2
|
|||
|
|||
bound form and updates
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 "85ascMcLaren" wrote in message ... 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 |
#3
|
|||
|
|||
bound form and updates
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 "Graham R Seach" wrote: 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 "85ascMcLaren" wrote in message ... 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 |
#4
|
|||
|
|||
bound form and updates
85ascMcLaren wrote:
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. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#5
|
|||
|
|||
bound form and updates
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 "85ascMcLaren" wrote in message ... 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 "Graham R Seach" wrote: 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 "85ascMcLaren" wrote in message ... 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 |
#6
|
|||
|
|||
bound form and updates
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 "Rick Brandt" wrote: 85ascMcLaren wrote: 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. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#7
|
|||
|
|||
bound form and updates
85ascMcLaren wrote:
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? -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|