OK, I have been using MS Access for quite some time now (since Access 2.0), but I have never gotten a handle on VBA. I use the event procedures and such, behind forms and copy code from Macros that do what I want (mostly). But I don’t really understand those three page long blurbs of code (that people frequently post on these boards), or where I should put them, or how to make them run.
So, that said maybe I am too much of a novice at VBA, but I would like to know how to do something if anyone is willing to tell me EXACTLY what to do. Here goes:
I have a table (say table name is "Problem Count"). The table has four fields. The Field names are ID (PK), Region (this is a text field representing the region), Problem (which is the problem text field that I wish to rank), Count (which is a count of the problem).
What I wish to do is make a new table based on the previous one, which lists each region (ten times) and the top ten problems within each region and the counts of each problem. So the table should look something like:
Region Problem Count
…
West Coast problem-A 250
West Coast problem-C 247
West Coast problem-D 222
West Coast problem-X 127
West Coast problem-M 125
West Coast problem-T 100
West Coast problem-Y 50
West Coast problem-B 45
West Coast problem-E 23
West Coast problem-O 1
Western Problem-D . . .
There’s a kicker. . .some of the regions don’t have 10 problems they may have 9 or 8 total. . .but others may have 35 and such. In the case of less than 10 (say 9), I want the region to appear in a 10th record (for said region) and have a null value appear in the problem field and Zero appear in the count field.
Also once the code is written. . .where do I put it? I'm assuming it goes in the Module section, but do I simply cut and paste it there, or is there something special that you need to do to make it create the table. . .
If anyone wishes to attempt to help the helpless . . .thank you in advance
Gary
So, that said maybe I am too much of a novice at VBA, but I would like to know how to do something if anyone is willing to tell me EXACTLY what to do. Here goes:
I have a table (say table name is "Problem Count"). The table has four fields. The Field names are ID (PK), Region (this is a text field representing the region), Problem (which is the problem text field that I wish to rank), Count (which is a count of the problem).
What I wish to do is make a new table based on the previous one, which lists each region (ten times) and the top ten problems within each region and the counts of each problem. So the table should look something like:
Region Problem Count
…
West Coast problem-A 250
West Coast problem-C 247
West Coast problem-D 222
West Coast problem-X 127
West Coast problem-M 125
West Coast problem-T 100
West Coast problem-Y 50
West Coast problem-B 45
West Coast problem-E 23
West Coast problem-O 1
Western Problem-D . . .
There’s a kicker. . .some of the regions don’t have 10 problems they may have 9 or 8 total. . .but others may have 35 and such. In the case of less than 10 (say 9), I want the region to appear in a 10th record (for said region) and have a null value appear in the problem field and Zero appear in the count field.
Also once the code is written. . .where do I put it? I'm assuming it goes in the Module section, but do I simply cut and paste it there, or is there something special that you need to do to make it create the table. . .
If anyone wishes to attempt to help the helpless . . .thank you in advance

Gary