I am in the learning stages on MS Access and VBA for access, know more
about some parts then others. But it dones't look that bad, the VBA,
because I am used to VBA for Excel, but I am not sure about this code,
esspecially the part of what is done after the tables are selected....
Would really appreciate it :- ) if someone would kindly help me out,
thanks ahead of time.
Thank you!!!
Option Compare Database
Option Explicit
Private Sub Command0_Click( )
Dim SQL As String
On Error GoTo Err_Duplicate
ADOCurrentProje ctConnect
SQL = ""
SQL = "SELECT a.field5 as rectime1, b.field8 as rectime2 " & _
"FROM receiving a, dockside b " & _
"WHERE a.field2 = b.field4 AND a.field5 IS NULL;"
rst2.Open SQL, cnn2, adOpenStatic, adLockOptimisti c, adCmdText
If rst2.EOF = False Then
rst2.MoveFirst
End If
Do While Not (rst2.EOF)
rst2!rectime1 = rst2!rectime2
rst2.Update
rst2.MoveNext
Loop
MsgBox "Completed. Export MS_Market and Receiving Tables as *.txt files
to Desktop."
rst2.Close
CloseConnection
Exit Sub
Err_Duplicate:
If Err.Number = errorNumDup Or Err.Number = errorNumRange Or Err.Number
= errorType Then
Resume Next
End If
Err.Raise Err.Number
End Sub
about some parts then others. But it dones't look that bad, the VBA,
because I am used to VBA for Excel, but I am not sure about this code,
esspecially the part of what is done after the tables are selected....
Would really appreciate it :- ) if someone would kindly help me out,
thanks ahead of time.
Thank you!!!
Option Compare Database
Option Explicit
Private Sub Command0_Click( )
Dim SQL As String
On Error GoTo Err_Duplicate
ADOCurrentProje ctConnect
SQL = ""
SQL = "SELECT a.field5 as rectime1, b.field8 as rectime2 " & _
"FROM receiving a, dockside b " & _
"WHERE a.field2 = b.field4 AND a.field5 IS NULL;"
rst2.Open SQL, cnn2, adOpenStatic, adLockOptimisti c, adCmdText
If rst2.EOF = False Then
rst2.MoveFirst
End If
Do While Not (rst2.EOF)
rst2!rectime1 = rst2!rectime2
rst2.Update
rst2.MoveNext
Loop
MsgBox "Completed. Export MS_Market and Receiving Tables as *.txt files
to Desktop."
rst2.Close
CloseConnection
Exit Sub
Err_Duplicate:
If Err.Number = errorNumDup Or Err.Number = errorNumRange Or Err.Number
= errorType Then
Resume Next
End If
Err.Raise Err.Number
End Sub
Comment