SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 19th, 2003, 08:19 AM
jayrye715 jayrye715 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 35 jayrye715 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Updating Database

I have a form that has a datacombo box on it and I have it setup with a list from a different table then the rest of the form I have it working and populating. What I need is when I make my selection I need the column in the main table to be updated with this new selection. Also when I go to the next record I need that field to be blank or contain the selection that has already been made. So what I need is the selection to be put in the correct column and stay there unless it is changed. below is the code used to populate the datacombobox.

Private Sub Populatecombobox1()


'Dim rscb As New Recordset
'On Error GoTo errorHandler
'Set rscb = New Recordset
'rscb.Open "Select TeamMember_ID,FName&' '&LName as UName from Team order by FName", conn, adOpenDynamic, adLockReadOnly

If rscb.RecordCount > 0 Then

With DataCombo1(0)
.Text = rscb!FName
Set .RowSource = rscb
.DataMember = "Test"
.DataField = "Analysis_Owner"
.ListField = "FName"

End With
rscb.MoveFirst
End If
Set rscb = Nothing



End Sub

Thanks in advance for any help.

Reply With Quote
  #2  
Old June 21st, 2003, 01:16 AM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
One way is to open the original table, and then before you update a field, compare the original value with the value being submitted.

If value submitted <> value original Then
'update database cause the value has changed
End if.

HTH
__________________
How can I soar like an eagle when
I'm flying with turkey's?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Updating Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway