Aggregation code with like function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Do Until rst.EOF
If strColumn2 = rst!SERIALNO And strColumn7 = rstdivi and strcolumn2 <>
rst!serialno like "*generic*" Then

strColumn1 = strColumn1 & "-" & rst!JobN
strColumn5 = strColumn5 + rst!amount
strColumn3 = rst!Model
strColumn4 = rst!CustN
strColumn7 = rst!divi


Hi

I am aggregation cancatinating this list of machines by serial number and
cancatinate the job number
but
Some job have Generic serialno. ( machine not arrived yet) on them
how do you make it not cancatinate my like statement doesnt pick up the
gerneice serial no please help

thanks
 
InStr(nz(rst!serialno), "generic") = 0

just threw NZ (null to zero) in there in case rst!serialno is not filled out


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Hi

thanks for the reply but it doesnt work there no wildcard and when i put one
in it didnt work
i think it loops too must
any other suggestions
 
can you please give examples of what the generic numbers look like?


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Hi

instead of serial numbers they use genrice which i dont what to group leave
them separate
Thanks in advance

GENERIC-VIC
GENERIC-VIC
GENERIC-VIC
GENERIC-VIC
GENERIC-QLDSALE
GENERIC-QLDSALE
GENERIC-QLDSALE
GENERIC-QLDSALE
GENERIC
GENERIC
GENERIC
 
Hi (what is your name?)

InStr(nz(rst!serialno), "generic") = 0

will eliminate records that have "generic" in the serialno field -- you
would have to combine this criteria with your other criteria. I could
not do that because I don't know the purpose of what you are doing or
your data

~~~

Instead of looping through the recordset, why not use an UPDATE query?
It is easier and faster.

for better understanding, download and read this:

Access Basics
http://allenbrowne.com/tips.html
Tips for Casual Users
Access Basics: free tutorial - Word document by Crystal (Access MVP)

30-page Word document on Access Basics (for Programming) -- it doesn't
cover VBA, but prepares you for it because it covers essentials in Access.


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Back
Top