Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 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."
John Henry is offline  
Old 05-25-2004, 05:00 AM   #2 (permalink)
Psycho
 
You should be able to use the UpdateRecord method of the data control in your button click event.
wondash is offline  
Old 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."
John Henry is offline  
Old 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.
wondash is offline  
 

Tags
basic, binding, controls, datafields, visual


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 06:02 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76