Re: Need help with Code Please!!!
- From: Dale Fye <dale.fye@xxxxxxxxxx>
- Date: Wed, 9 Apr 2008 06:16:01 -0700
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.<SNIP>
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.
But DISTINCT returns unique values, unlike DISTINCTROW.
- Follow-Ups:
- Re: Need help with Code Please!!!
- From: Lisa
- Re: Need help with Code Please!!!
- References:
- Need help with Code Please!!!
- From: Lisa
- RE: Need help with Code Please!!!
- From: Lisa
- RE: Need help with Code Please!!!
- From: Klatuu
- RE: Need help with Code Please!!!
- From: Lisa
- RE: Need help with Code Please!!!
- From: Dale Fye
- Re: Need help with Code Please!!!
- From: Stuart McCall
- Need help with Code Please!!!
- Prev by Date: RE: Multiple filters and new record creation problem
- Next by Date: Re: SQL Not Updating
- Previous by thread: Re: Need help with Code Please!!!
- Next by thread: Re: Need help with Code Please!!!
- Index(es):
Relevant Pages
|
Loading