User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,376 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,989 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 874 | Replies: 8
Reply
Join Date: Feb 2008
Posts: 15
Reputation: regalla_c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
regalla_c regalla_c is offline Offline
Newbie Poster

linking of two fields and updating database

  #1  
Feb 14th, 2008
i have two forms and on each form one text box having access database behind and is connected to forms by using data bound controls. My problm is that what ever value i enter form1.text1 , it should come in form2.text1. iam using code like this
in form1 lost focus event text1.text= form2.text1.text . it is ok . but how to update database simultaneously form1 and form2 sa time. please any body give answer in detail
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: India
Posts: 494
Reputation: choudhuryshouvi is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 45
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro in Training

Re: linking of two fields and updating database

  #2  
Feb 14th, 2008
just clear this out first.

will the values from both textboxes update the same field or u need to update two separate fields with these two values simultaneously?

if i wrong judged this then plz make me correct
Last edited by choudhuryshouvi : Feb 14th, 2008 at 3:26 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote  
Join Date: Feb 2008
Posts: 15
Reputation: regalla_c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
regalla_c regalla_c is offline Offline
Newbie Poster

Re: linking of two fields and updating database

  #3  
Feb 14th, 2008
My intension is whatever the value i enter form1.text1 ,it should be automatically entered in form2.text1 and table1,table2 which are connected with databound control with access database should be updated in database. will you please give me codent code in form1, form2 to do the above mentioned.
Reply With Quote  
Join Date: Jul 2007
Location: Philippines
Posts: 205
Reputation: jireh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 22
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz in Training

Re: linking of two fields and updating database

  #4  
Feb 16th, 2008
is these two forms are both open? geh hard to picture out... why do you need your form acts that way? can you please state what you are really up to?
Reply With Quote  
Join Date: Feb 2008
Posts: 15
Reputation: regalla_c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
regalla_c regalla_c is offline Offline
Newbie Poster

Re: linking of two fields and updating database

  #5  
Feb 16th, 2008
Iam explaning this prooblem indetail. first i prepared data base in ms access named Name.mdb and made 2 tables table1,table2 which is having one text box in each. next in front end form1 i put one text box, form2 also i put one text box and connected with table1, table2 with data bound control. i put code in form2 text gotfocus event that text1.text= form1.text1.text. iam getting the current value whatever is being entered in form1.but iam not understanding how to update database in table2 while entering the values in form1.text1 only. iwant to link form1.text1 with form2.text1 and to update database.please explain this in detail with code writting
Reply With Quote  
Join Date: Jan 2008
Posts: 7
Reputation: Sroxx is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Sroxx Sroxx is offline Offline
Newbie Poster

Re: linking of two fields and updating database

  #6  
Feb 18th, 2008
i wuld also like to have the same problem solved as its makin trouble 4 me aswell
Reply With Quote  
Join Date: Feb 2008
Posts: 15
Reputation: regalla_c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
regalla_c regalla_c is offline Offline
Newbie Poster

Re: linking of two fields and updating database

  #7  
Feb 22nd, 2008
My intension is by entering values in form1.text1, it should appear in form2.text1 when it is opened and database ie table1. table2 should be udpated. please any one give code and in which event we have to write code
Reply With Quote  
Join Date: Feb 2008
Posts: 15
Reputation: regalla_c is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
regalla_c regalla_c is offline Offline
Newbie Poster

Re: linking of two fields and updating database

  #8  
Mar 8th, 2008
i want to update database which is having two tables which are linked with two forms ie form1,form2 when i enter data in form1 only , so please give me code how to udpate database
Reply With Quote  
Join Date: May 2007
Location: India
Posts: 494
Reputation: choudhuryshouvi is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 45
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro in Training

Troubleshooting Re: linking of two fields and updating database

  #9  
Mar 9th, 2008
Dim gcn As New ADODB.Connection

gcn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<your access database path>;Persist Security Info=False"
gcn.Open
gcn.Execute "update <your table name> set <field name> = <value> where <criteria expression>"

is this enough?
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 3:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC