Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement

Status
Not open for further replies.

1000kisoen

IS-IT--Management
Aug 12, 2004
37
NL
HI,
When running this SQL is receive an error that the FROM statement is not correct.
please advise

Private Sub cmdviewbudget_Click()
Dim db As DAO.DATABASE
Dim rs As Recordset
Dim strSQL As String

strSQL = "select ccentre,ccactuals from Query2, " & _
" WHERE Ccentre = " & Me.Ccentre

Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)

Me.viewbudget.RowSource = strSQL
Set db = Nothing
Set rs = Nothing
End Sub

gr. Kisoen
 
I'm not sure, but it may be caused by the comma after Query2, I think it should be:

strSQL = "select ccentre,ccactuals from Query2 " & _
" WHERE Ccentre = " & Me.Ccentre
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top