progismaps
asked on
Access 2013 - assign the value of an unbounded object to a table value
Is there a way to take the value of an unbounded text box and assign it the value in a table?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Typically, Access forms are bound and therefore you would not need extra code to save data. Why is the form unbound if you want to save the data?
Pat has a good question. One possible reason to have an unbound form is that you need to do extensive error-trapping before saving or updating a record. Is that the case here?
Unbound forms are used for capturing parameters to run reports or for entering criteria for a search form. In rare situations, you might add unbound controls to a main form to use to insert rows to a bound subform that is not updateable or which you don't want the user to update directly. As long as you understand the Access event model, bound forms can be made to save or not save based on your validation rules. Unbound forms are sometimes used when the BE is SQL Server (or other relational database) to which you connect remotely over a WAN. Access can in some cases be sluggish and using an unbound form can sometimes help.
ASKER
I was having issue where users were partially filling in a form that had bounded objects. I then decided to change objects from bounded to unbounded, but that presented an issue with assigning a value from an unbounded object to table entry. Finally, abandoned that idea and just wrote VBA code for "Before Update" that checked that certain mandatory fields were filled in and then changed the save to check for Me.Dirty before saving.
That was the correct solution. It is amazing the control you have once you understand the form's event model well enough to use the events for their intended purpose.
As I said, there are valid reasons for using unbound forms but controlling when and what to save isn't one of them. Using the correct events for validation will give you all the control you need.
As I said, there are valid reasons for using unbound forms but controlling when and what to save isn't one of them. Using the correct events for validation will give you all the control you need.
That was the correct solution. It is amazing the control you have once you understand the form's event model well enough to use the events for their intended purpose.I take it back. Based on the answer you selected, you are not using the correct form events that would allow Access to control the process. You are still doing it manually which is certainly your choice but a lot more work and not the "Access way".
Open in new window