mdmackillop
06-05-2009, 10:39 AM
The following should produce a single result. How do I get it to enter the Value into my worksheet?
It's been a long day!!!
Sub GetAddr()
Dim oConn As Object
Dim sSQL As String
Dim Sql As String
Dim Addr As String
Set oConn = CreateObject("ADODB.Connection")
oConn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\Database\ValData2000.mdb"
sSQL = "SELECT ValPropDet.Record_Number, [NameNo] & ' ' & [Street] & ' ' & [town] AS Addr " & _
"FROM ValPropDet " & _
"WHERE (((ValPropDet.Record_Number)=" & [B26] & "));"
oConn.Execute sSQL
oConn.Close
Set oConn = Nothing
End Sub
It's been a long day!!!
Sub GetAddr()
Dim oConn As Object
Dim sSQL As String
Dim Sql As String
Dim Addr As String
Set oConn = CreateObject("ADODB.Connection")
oConn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\Database\ValData2000.mdb"
sSQL = "SELECT ValPropDet.Record_Number, [NameNo] & ' ' & [Street] & ' ' & [town] AS Addr " & _
"FROM ValPropDet " & _
"WHERE (((ValPropDet.Record_Number)=" & [B26] & "));"
oConn.Execute sSQL
oConn.Close
Set oConn = Nothing
End Sub