Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Categorize in Access 2007 1

Status
Not open for further replies.

valgore

Technical User
Nov 12, 2008
180
US
ok. i have a table called Category Codes. the 2 fields are Vendor and Category Code. the Vendor field are businesses and the Category Code field has two letters in it. when i import a bill into AmexCurrent, i want the Vendor field from AmexCurrentto look at the CategoryCodes table and say

If Vendor field in Category Codes is like the Vendor field in AmexCurrent, then insert CategoryCodes field from Vendor into Category Codes field in AmexCurrent.

my problem is, the vendor field in AmexCurrent looks something like this when it is imported

ALASKA WILD BERRY D49504-69695


and the vendor field in CategoryCodes table looks something like this

Alaska Wild Berry

will the like function match those?

hope this all makes sense.

Valgore

 
You may try a criteria like this:
Code:
UCase(AmexCurrent.[vendor field]) Like UCase(CategoryCodes.[vendor field]) & '*'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
so does this code input data into the vendor field in AmexCurrent? from what i know (not much), it doesn't.

i changed it to
Code:
UCase([AmexCurrent!Merchant Name/Location!]) Like UCase([CategoryCodes!Vendor!]) & '*'
because of Access 2007 syntax, but i get a compile error: expected epression on the first '
i also got an error on your original code as well.

Valgore
 
Could you please post the whole code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Code:
DoCmd.RunSQL "INSERT INTO AmexCurrent Select [CategoryCodes]![Vendor] as [Vendor] From CategoryCodes WHERE UCase(AmexCurrent.Merchant Name/Location) Like UCase(CategoryCodes.Vendor) & '*'"

i get syntax error.
 
What about something like this ?
Code:
DoCmd.RunSQL "UPDATE AmexCurrent,CategoryCodes SET AmexCurrent.[[i]name of category code[/i]]=CategoryCodes.[Category Code] WHERE UCase(AmexCurrent.[Merchant Name/Location]) Like UCase(CategoryCodes.Vendor) & '*'"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
wow. you are amazing. works perfectly!!!!!!

Valgore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top