05-21-2004, 01:48 AM | #1 (permalink) |
Addict
Location: Grey Britain
|
[Visual Basic 6.0] Binding Controls to DataFields
I have a database front end in which I'm experimenting with using properties, binding etc. instead of lots of longwinded code. I have textboxes and comboboxes bound to a data control, connecting to fields in a database (sorry if my terminology is a bit out here) This is working nicely except that editing any of the textboxes automatically changes the respective entry in the database, without me calling the update method.
By preference, it'd be set up so that when users edit a textbox, they have to click a button to update the database and otherwise it would just stay as it was. Question is, can this be done while I'm still binding controls to the data control or do I have to do it by steam?
__________________
"No one was behaving from very Buddhist motives. Then, thought Pigsy, he was hardly a Buddha, nor was he a monkey. Presently, he was a pig spirit changed into a little girl pretending to be a little boy to be offered to a water monster. It was all very simple to a pig spirit." |
05-26-2004, 03:54 AM | #3 (permalink) |
Addict
Location: Grey Britain
|
That's how I set it up originally, but it was updating records without the button being pressed. I think there's some property to do with the binding that I have to change, but I can't get the right window open to do it.
__________________
"No one was behaving from very Buddhist motives. Then, thought Pigsy, he was hardly a Buddha, nor was he a monkey. Presently, he was a pig spirit changed into a little girl pretending to be a little boy to be offered to a water monster. It was all very simple to a pig spirit." |
05-28-2004, 05:21 AM | #4 (permalink) |
Psycho
|
When do you think the update is occurring? Is it when your bound control loses focus? I created a simple test project with a textbox, button, and datacontrol. I linked the datacontrol to an access database and bound the textbox to a field in a test table. If I change the data in the textbox, the update will only occur when I change records (using the datacontrol), or execute the UpdateRecord method. Tabbing off the control does not cause an update.
|
Tags |
basic, binding, controls, datafields, visual |
|
|