T
TM
I am trying to filter through some records and set a
listbox recordsource equal to this recordset. I need to
have records which are not equal to three different
parameters which can vary, so I am using variable which
point to the appropriat object on the appropriate form.
Hope this is making sense. Anyway, doing a simple select
query with "or" statements doesn't seem to work. So, I
am trying to build an initial recordset and then filter
out the next set of records and then the third. This is
what I have...
strCritC = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strCat & ";"
strCritA = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strArea & ";"
strCritI = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strIndex & " ORDER BY tblMain.[SOP
Name]"
Set rstCat = db.OpenRecordset(strCritC, dbOpenSnapshot)
Set rstCat = db.OpenRecordset(strCritA, dbOpenSnapshot)
Set rstCat = db.OpenRecordset(strCritI, dbOpenSnapshot)
Me![lblListSOPs].Caption = "Other"
Me![lstSOPs].RowSource = rstCat
I'm hoping this will work - for now I am getting a "too
few parameters expecting 1" error message (I believe no
3051). I have used the debug feature and checked the
select statement. I actually get the error on the
first "set rstCat" line. Any suggestions? I am open to
different ideas on how to do this AND ways to fix this
current error.
Thanks in advance!
listbox recordsource equal to this recordset. I need to
have records which are not equal to three different
parameters which can vary, so I am using variable which
point to the appropriat object on the appropriate form.
Hope this is making sense. Anyway, doing a simple select
query with "or" statements doesn't seem to work. So, I
am trying to build an initial recordset and then filter
out the next set of records and then the third. This is
what I have...
strCritC = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strCat & ";"
strCritA = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strArea & ";"
strCritI = "SELECT tblMain.SOPid, tblMain.[SOP Name],
tblMain.Category, tblMain.Area, tblMain.Index FROM
tblMain WHERE " & strIndex & " ORDER BY tblMain.[SOP
Name]"
Set rstCat = db.OpenRecordset(strCritC, dbOpenSnapshot)
Set rstCat = db.OpenRecordset(strCritA, dbOpenSnapshot)
Set rstCat = db.OpenRecordset(strCritI, dbOpenSnapshot)
Me![lblListSOPs].Caption = "Other"
Me![lstSOPs].RowSource = rstCat
I'm hoping this will work - for now I am getting a "too
few parameters expecting 1" error message (I believe no
3051). I have used the debug feature and checked the
select statement. I actually get the error on the
first "set rstCat" line. Any suggestions? I am open to
different ideas on how to do this AND ways to fix this
current error.
Thanks in advance!