Re: Need help with Code Please!!!



I was going to say that given that her first query that defines her recordset
only selects Company and USFSItemNo, that I think DISTINCT is what she
probably needed.

Then I copied the SQ1 code and pasted it into Word, and found that she never
references either of those recordsets fields in the query that she is
building inside the loop, so I don't know what she is doing. The only reason
I can think of for building the other query inside of the loop is to
reference the values in the recordset that is being looped through.

Additionally:
1. She has numerous lines where she needs to insert a space before the
"AND" or "WHERE" so that the spacing will be correct.

2. She has referenced the controls for txtBeginningDate and txtEndingDate
inside of the quotes in here WHERE clause, so that won't work. Should
probably look like:

SQ1 = SQ1 & " WHERE tblInvoiceHistAll.[Ship Date] BETWEEN #" _
& Forms![frmReportRebateParameters]!txtBeginningDate & "# AND #"
& Forms![frmReportRebateParameters]! & "# "

3. She also refers to a value 'e-mail' in her WHERE clause that is not a
declared variable, so it probably needs to be wrapped in quotes, like:

SQ1 = SQ1 & " AND tblItemListVendor.BillBackDelivMethod = 'e-mail'))"

Lisa, I hope some of these comments will help.

Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Stuart McCall" wrote:

"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:9A40E978-A83D-426C-9CFB-C1C11B3582E8@xxxxxxxxxxxxxxxx
I would also recommend that you replace your DISTINCTROW with DISTINCT.

DISTINCTROW looks at all of the fields in the joined table, so it takes
longer than DISTINCT, which only looks at the fields in the query.
<SNIP>

But DISTINCT returns unique values, unlike DISTINCTROW.




.



Relevant Pages

  • Re: Help with Microsoft help on linking Access to Outlook
    ... Tools - references - tick Microsoft Outlook object library. ... in the criteria cell in the graphical query builder. ... the same filtered recordset every time. ... normal form to allow the normal filtering process and viewing of the ...
    (microsoft.public.access.formscoding)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... in the criteria cell in the graphical query builder. ... use as the source in the routine. ... the same filtered recordset every time. ... normal form to allow the normal filtering process and viewing of the ...
    (microsoft.public.access.formscoding)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... and have the query point to the combo box to get its value. ... the same filtered recordset every time. ... choose themselves what fields to filter on. ... Set MyRS = MyDB.OpenRecordset" ...
    (microsoft.public.access.formscoding)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... in the criteria cell in the graphical query builder. ... use as the source in the routine. ... the same filtered recordset every time. ... normal form to allow the normal filtering process and viewing of the ...
    (microsoft.public.access.formscoding)
  • Re: How do I retrieve the median value of a field?
    ... Access 2000 and 2002 only have references to ADO. ... For example, to ensure that you get a DAO recordset, you'll need to ... I corrected the query> and defined the two arguements as the table and the field names. ... One the name of the table,>> and secondly the name of the field you want to generate the median on. ...
    (microsoft.public.access.queries)

Loading