Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

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 ASP Free Forums Sponsor:
  #1  
Old March 23rd, 2004, 05:51 PM
drmojo77 drmojo77 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 137 drmojo77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 23 m 36 sec
Reputation Power: 6
VBA Question Part 2

my question is i have a database that has an unbound form that is running off of DAO. how would i make the code see that i need to pull data off on 2+ tables instead of just one here is a sample of the code.

Option Compare Database
Public Check1 As String


Private Sub cmboCustKey_AfterUpdate()
Me.txtCustKey = cmboCustKey.Column(0)
Me.txtcc169 = Val(cmboCustKey.Column(5))
Me.cc159 = Val(cmboCustKey.Column(6))
Me.cc149 = Val(cmboCustKey.Column(7))
Me.cc139 = Val(cmboCustKey.Column(8))
Me.cc129 = Val(cmboCustKey.Column(9))
Me.cc119 = Val(cmboCustKey.Column(10))
Me.cc109 = Val(cmboCustKey.Column(11))
Me.cc99 = Val(cmboCustKey.Column(12))
Me.cc89 = Val(cmboCustKey.Column(13))
Me.cd169 = Val(cmboCustKey.Column(14))
Me.cd159 = Val(cmboCustKey.Column(15))
Me.cd149 = Val(cmboCustKey.Column(16))
Me.cd139 = Val(cmboCustKey.Column(17))
Me.cd129 = Val(cmboCustKey.Column(18))
Me.cd119 = Val(cmboCustKey.Column(19))
Me.cd109 = Val(cmboCustKey.Column(20))
Me.cd99 = Val(cmboCustKey.Column(21))
.....
....
..
blah, blah

here is the rest of the code

please help.
thanks in advance.
chad
Attached Files
File Type: txt database code.txt (62.2 KB, 183 views)

Reply With Quote
  #2  
Old March 23rd, 2004, 10:31 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Essentially you perform two updates

You write the code to update one table, then update the second


Code:
    sSQL = "tblcustomer"
    Set ADOrs = New ADODB.Recordset
    ADOrs.Open sSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic

    With ADOrs
.
.
.
.
     .update
     End with
     set ADOrs = nothing


    sSQL = "SecondTable"
    Set ADOrs = New ADODB.Recordset
    ADOrs.Open sSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic

    With ADOrs
.
.
.
.
     .update
     End with
     set ADOrs = nothing



S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > VBA Question Part 2


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 1 hosted by Hostway
Stay green...Green IT