Syntax error in FROM Clause

aadebayo

Registered User.
Local time
Today, 18:12
Joined
May 10, 2004
Messages
43
Hello

I am currently having the above error in my code. I have searched the forum, but there is nothing similar. When the system gets to the code in RED, the above error is displayed. Please can anybody help me.

Code:
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim rstBatch As ADODB.Recordset
Dim select_query As String
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset
Set rstBatch = New ADODB.Recordset

calc_lines


select_query = "SELECT sum(debit_amount) as Total FROM tbjournal_line"
[COLOR=Red]rst.Open select_query, cnn, adOpenStatic, adLockOptimistic, adCmdTable[/COLOR]
total_debits = rst![Total]
rst.Close
 
put tbjournal_line in brackets: [tbjournal_line]

or maybe you misspelled your tablename, possibly [tblJournal_Line]
see if that helps.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom