|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > VBA Question Part 2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|