Alright I am using DAO to loop through a recordset(like my other
question, I still need help in my other question as well, but maybe I
can get a smaller answer here), but I am going to be way more specific
on what I need.
Set strSql = "SELECT tblProducts.Catalog, tblProducts.MaterialNumber,
tblProducts.Manufacturer, tblProducts.GMR, tblProducts.Category,
tblProducts.Description, tblProducts.[Sub-Category],
tblProducts.SortOrder, tblProducts.AddedNote, tblProducts.Required,
tblProducts.NoList, tblProducts.Hyper_Link, tblProducts.ProductID,
tblProducts.Deleted, tblProducts.Cost From tblProducts WHERE
(((tblProducts.Manufacturer) Is Not Null And
(tblProducts.Manufacturer) Like " & rsQuery!Manufacturers & ") AND
((tblProducts.Deleted)=False));"
My question is when I am using DAO how should I be referring to what I
need "rsQuery!Manufacturers" or should it be a string like strManuf
and how would I go about declaring that (as DAO.recordset?)
Thanks,
Matt
mscertified - 21 Mar 2007 15:50 GMT
Dim rs as new DAO.recordset
rs.fields("Fieldname").Value
don't foreget do do a
rs.close
set rs = nothing
at the end of your procedure
-Dorian
> Alright I am using DAO to loop through a recordset(like my other
> question, I still need help in my other question as well, but maybe I
[quoted text clipped - 17 lines]
> Thanks,
> Matt
mscertified - 21 Mar 2007 15:53 GMT
By the way your 'SELECT' statement is invalid. You need a FROM clause.
-Dorian
> Alright I am using DAO to loop through a recordset(like my other
> question, I still need help in my other question as well, but maybe I
[quoted text clipped - 17 lines]
> Thanks,
> Matt
John W. Vinson - 21 Mar 2007 19:51 GMT
>Alright I am using DAO to loop through a recordset(like my other
>question, I still need help in my other question as well, but maybe I
[quoted text clipped - 14 lines]
>need "rsQuery!Manufacturers" or should it be a string like strManuf
>and how would I go about declaring that (as DAO.recordset?)
You're not using DAO, not yet anyway. You've set up a text string and (in your
posted code) you've said nothing at all about recordsets. Where is rsQuery
defined? Do you have a previous OpenRecordset action?
I'd avoid using LIKE unless you explicitly want to use wildcards. The =
operator is more efficient. If Manufacturer is a Text field you'll also need
quotemark - Chr(34) is " -delimiters:
tblProducts.Manufacturer = " & Chr(34) & rsQuery!Manufacturers & Chr(34) & ")
John W. Vinson [MVP]
David W. Fenton - 22 Mar 2007 15:38 GMT
> Alright I am using DAO to loop through a recordset
What are you doing when looping through the recordset? If you're
updating a bunch of records to the same value or to some value that
can be calculated from the values in the same row, then a SQL UPDATE
query would likely be vastly faster.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/