I have the following routine that I call when I click on a button in a form:
Private Sub View_Report_Of_Features_And_Activites_Click()
On Error GoTo Err_View_Report_Of_Features_And_Activites_Click
Dim stDocName As String
Dim SQL As String
SQL = "SELECT All_Trial_Details.[Technology]" & _
"FROM [All_Trial_Details]" & _
"WHERE All_Trial_Details.[Activity Name]=ActivityNameComboBox;"
DoCmd.RunSQL SQL
If All_Trial_Details.[Technology] = "Java" Then
stDocName = "Java Activities And Features Report"
Else
stDocName = "CD Activities And Features Report"
End If
DoCmd.OpenReport stDocName, acPreview
Exit_View_Report_Of_Features_And_Activit:
Exit Sub
Err_View_Report_Of_Features_And_Activites_Click:
MsgBox Err.Description
Resume Exit_View_Report_Of_Features_And_Activit
End Sub
When I run this, I get an error that says that my SQL statement is invalid. Help.
2007-05-29
09:31:18
·
4 answers
·
asked by
qbros
1
in
Computers & Internet
➔ Programming & Design