miguel vasquez
Registered User.
- Local time
- Today, 23:55
- Joined
- Nov 11, 2002
- Messages
- 36
Hi Guys,
I am having problem with this programming, since my where condition is reading my parameters. My parameter strRPT and strDept are getting the assinged value, but my where condition is not reading them.
Please help!!!
Private Sub Command27_Click()
Dim strRpt1 As String
Dim strRpt2 As String
Dim strRpt As String
Dim strDept As String
strRpt = "'" & Me.TypeOfReport & "'"
strDept = "'" & Me.DeptName & "'"
strRpt1 = "Select * into ReportTable from MainTable"
If Me.TypeOfReport <> "Both" And Me.DeptName <> "All" And (Eval("[Forms]![MainForm]![DOSfrom] Is not Null")) And (Eval("[Forms]![MainForm]![DOSto] Is not Null")) Then
strRpt1 = strRpt1 & " Where me.typeOfReport = strRpt and Me.DeptName = strDept"
DoCmd.RunSQL strRpt1
DoCmd.OpenTable "ReportTable", acNormal, acEdit
End If
I am having problem with this programming, since my where condition is reading my parameters. My parameter strRPT and strDept are getting the assinged value, but my where condition is not reading them.
Please help!!!
Private Sub Command27_Click()
Dim strRpt1 As String
Dim strRpt2 As String
Dim strRpt As String
Dim strDept As String
strRpt = "'" & Me.TypeOfReport & "'"
strDept = "'" & Me.DeptName & "'"
strRpt1 = "Select * into ReportTable from MainTable"
If Me.TypeOfReport <> "Both" And Me.DeptName <> "All" And (Eval("[Forms]![MainForm]![DOSfrom] Is not Null")) And (Eval("[Forms]![MainForm]![DOSto] Is not Null")) Then
strRpt1 = strRpt1 & " Where me.typeOfReport = strRpt and Me.DeptName = strDept"
DoCmd.RunSQL strRpt1
DoCmd.OpenTable "ReportTable", acNormal, acEdit
End If