Hi Klatuu,
I am not trying to use a filter.
I am using strCriteria to insert records into a table, reading from another
table.
What i am trying to do is eliminate column 1, and change column 2 to rows
instead of a column.
Here is my earlier post:
Hi,
I have two record sets open - i am trying to take data from the first record
set and add it to another.
In my first recordset, there are two columns (for example):
Col 1 Col 2
JOB JOB15XY
JOBNAME STRDMTTYS
JOBID 134565
JOB .....
JOBNAME .....
JOBID .....
etc
Col 1 repeats many times over - its a waste of space having JOB, JOBNAME and
JOBID repeated somany times.
What I am tring to do is use the values in col 1 as headings in a new table,
and copy the details of col2 - so the recordset will look like this:
JOB JOBNAME JOBID
JOB15XY STRDMTTYS 134565
The code i am trying to use is as follows:
rst1.AddNew
rst1![DateStamp] = strDate
rst1![FileNo] = strFileNo
rst1!strReadFeild1 = strFeild2 <----- Item not found error
strReadFeild1 is a string varible which reads col 1 value from the first
recordset.
If I try and use the string in second recordset, an Item Not Found Error is
returned.
Klatuu said:
How about you tell us what you are trying to do, and we can help with the how.
You don't normally set a filter on an open recordset. It is done when you
open the recordset, so what you are doing will not work.
--
Dave Hargis, Microsoft Access MVP
GLT said:
Hi Gents,
Thanks for your assistance here - its been invaluble...
How do I execute strCriteria - I tried this:
rst1.AddNew
rst1![DateStamp] = strDate
rst1![FileNo] = strFileNo
strCriteria
The above gives me a compile error - do I need to put the rst1. in front of
strCriteria?
Cheers,
GLT.
:
Not enough info to give a completely correct answer, but based on what you
posted and assuming strFeild is a text field:
strCriteria = "rst1![" & strFeild & "] = """ & strReadFeild & """"
But,typically, you don't include the recordset name you are trying to
filter, so it probably should be:
strCriteria = "[" & strFeild & "] = """ & strReadFeild & """"
--
Dave Hargis, Microsoft Access MVP
:
Can anyone advise the correct syntax for the following line?
strCriteria = "rst1![""" & strFeild & "]" & "" = strReadFeild
Any help is always greatly appreciated...
Cheers,
GLT