I am having problem with the select statement of this code, for some reason when I ran this project it comes bact with this error message syntax error in From Clause, and it highlights this line of code rs.Open StrSQL, ad, adOpenDynamic, adLockOptimistic, adCmdText
Thanks for your help
_al
************************************************** ********************************************



Private Sub Form_Load()
Dim StrSQL As String
'Open a database connection
Dim rs As ADODB.Recordset
Dim ad As ADODB.Connection
Set ad = New ADODB.Connection
ad.Provider = "Microsoft.ACE.OLEDB.12.0"
'ad.ConnectionString = "Data Source=C:\TripLogDesign\Triplogmdb.accdb"
ad.ConnectionString = "Data Source=C:\TripLogDesign\TripLogmdb.accdb"
ad.Open
Set rs = New ADODB.Recordset
StrSQL = "SELECT T.CompanyName FROM Triplogtbl" & _
"WHERE CampanyName IS NOT NULL"
rs.Open StrSQL, ad, adOpenDynamic, adLockOptimistic, adCmdText
If Not rs.BOF And Not rs.EOF Then
txtCompanyName.Text = rs.Fields("CompanyName").Value
End If
rs.Close
Set rs = Nothing
ad.Close
Set ad = Nothing
End Sub