Tezcatlipoca
Registered User.
- Local time
- Today, 16:18
- Joined
- Mar 13, 2003
- Messages
- 246
Hi All,
Ok, simple layout. I have a form with a unbound textbox on it called txtData.
This has a control source of the field fldData in the table tblData. This field in the table contains alphanumeric data. All nice and simple so far.
Now the textbox is set to be unenabled when the form is loaded. There is a button on the form called btnEdit. Clicking this button simply fires a 'Me.txtData.Enabled = True' command then sets the focus into that box, ready for the user to edit the data directly.
Now here's the tricky bit. I want to introduce a second button that allows the user to commit their changes. Eventually, this button will have a load of validation code to other objects on the form to ensure that a bad record cannot be saved, but for now I need to know how I can introduce a function that allows the user to click Edit and change the data in the field Data of tblData, but these changes should not be saved to the table until that Save button is clicked.
I know I can do this in a very sloppy way by presenting the user with a second textbox when they click edit that is populated with the contents of the table field but isn't controlled by the table field. The user then works on a copy which doesn't get saved to the table until a second button is clicked.
This solution is easy to implement, but there has to be a cleaner, neater way to do this, surely?
Ok, simple layout. I have a form with a unbound textbox on it called txtData.
This has a control source of the field fldData in the table tblData. This field in the table contains alphanumeric data. All nice and simple so far.
Now the textbox is set to be unenabled when the form is loaded. There is a button on the form called btnEdit. Clicking this button simply fires a 'Me.txtData.Enabled = True' command then sets the focus into that box, ready for the user to edit the data directly.
Now here's the tricky bit. I want to introduce a second button that allows the user to commit their changes. Eventually, this button will have a load of validation code to other objects on the form to ensure that a bad record cannot be saved, but for now I need to know how I can introduce a function that allows the user to click Edit and change the data in the field Data of tblData, but these changes should not be saved to the table until that Save button is clicked.
I know I can do this in a very sloppy way by presenting the user with a second textbox when they click edit that is populated with the contents of the table field but isn't controlled by the table field. The user then works on a copy which doesn't get saved to the table until a second button is clicked.
This solution is easy to implement, but there has to be a cleaner, neater way to do this, surely?