A
Aaron
Hi,
Sorry if the subject is confusing, doesn't make sense, or
just makes me look stupid. I've been learning Access on my own at work,
and I need to reproduce a functionality that we have in Excel...
Basically, let's say you have a pricing estimation method
that you've established for assigning costs to applications when the
application owners have been unable to estimate the price.
The method works like this: you have a 4-character code,
like MGWS, based on 4 different parameters of the application (like #
of users, etc.). There are about 20 codes, total, and about 1800
applications that fit into one of these code "categories."
Each category has an average cost and an average # of users,
based on data from each of the applications that DOES have cost
estimates. Every time a new application is "found," or cost information
is provided, it needs to add into the data for the appropriate code,
and change the averages for that code.
Additionally, every application, when displayed in a form or
report, has to be connected to the average data for the code "category"
in which the application resides.
In other words, say "excel" is an application, and its code
is MGWS. I need the report and form to be able to show the MGWS average
cost and average number of users next to "excel." Also, next to every
other MGWS application.
The only way I've been able to make this work in access so
far is to have two worksheets in Excel, one with details on all the
codes, as well as average information, and another with each code, row
by row, with the average information from the other worksheet listed in
the same row.
That summary table (the second table) can be put into Access,
and I can reference it to assign the right code costs to each
application.
The problem is that every time another cost comes in, I'll
have to repaste the table and remake all of the connections. I'd like
to update the detailed data in Access so that everything changes with
just a simple query.
Initially I've tried to program this, and I am running into
an error that I'll describe below. Basically, I used a pre-programmed
Access query to determine average data for each code, and then I tried
to create a second query that would put this information into a table,
row by row, in Access. In other words, each "row" would have a code,
and the average data, effectively recreating the table we have in
Excel.
Here is the SQL code I (and a programmer here) came up with
to take the average data from the first query and put it into the
table: UPDATE Code_Table SET Code_Table.[Count] = "Count of MGWM
Applications"
WHERE (((Code_Table.Code)="MGWM"));
Code_Table is the table we want to use to duplicate the Excel table
with one code per row.
MGWM_Applications_Query is the first query, where Access has pulled the
averages together for the one code.
[Count] is the Field in the Code_Table that holds the total count of
applications with that code.
"Count of MGWM Applications" is the automatically-generated field name
for Access's count of MGWM Applications.
Code is the field in the Code_Table that holds all of the 4-character
codes, like MGWM.
Here is the error I am getting: "Access did not update one field due to
a type conversion failure."
The field type for the Count of MGWM Applications is "General Number,"
and the field type for "Count" is "Number." What am I doing wrong?
By the way, if I replace all the code referencing the first query, and
just tell it to update Code_Table.Count as "2" where
Code_Table.Code="MGWM," it works.
Help! Am I trying to do the impossible, or am I just doing the really
hard incorrectly?
Thank you!
-Aaron
Sorry if the subject is confusing, doesn't make sense, or
just makes me look stupid. I've been learning Access on my own at work,
and I need to reproduce a functionality that we have in Excel...
Basically, let's say you have a pricing estimation method
that you've established for assigning costs to applications when the
application owners have been unable to estimate the price.
The method works like this: you have a 4-character code,
like MGWS, based on 4 different parameters of the application (like #
of users, etc.). There are about 20 codes, total, and about 1800
applications that fit into one of these code "categories."
Each category has an average cost and an average # of users,
based on data from each of the applications that DOES have cost
estimates. Every time a new application is "found," or cost information
is provided, it needs to add into the data for the appropriate code,
and change the averages for that code.
Additionally, every application, when displayed in a form or
report, has to be connected to the average data for the code "category"
in which the application resides.
In other words, say "excel" is an application, and its code
is MGWS. I need the report and form to be able to show the MGWS average
cost and average number of users next to "excel." Also, next to every
other MGWS application.
The only way I've been able to make this work in access so
far is to have two worksheets in Excel, one with details on all the
codes, as well as average information, and another with each code, row
by row, with the average information from the other worksheet listed in
the same row.
That summary table (the second table) can be put into Access,
and I can reference it to assign the right code costs to each
application.
The problem is that every time another cost comes in, I'll
have to repaste the table and remake all of the connections. I'd like
to update the detailed data in Access so that everything changes with
just a simple query.
Initially I've tried to program this, and I am running into
an error that I'll describe below. Basically, I used a pre-programmed
Access query to determine average data for each code, and then I tried
to create a second query that would put this information into a table,
row by row, in Access. In other words, each "row" would have a code,
and the average data, effectively recreating the table we have in
Excel.
Here is the SQL code I (and a programmer here) came up with
to take the average data from the first query and put it into the
table: UPDATE Code_Table SET Code_Table.[Count] = "Count of MGWM
Applications"
WHERE (((Code_Table.Code)="MGWM"));
Code_Table is the table we want to use to duplicate the Excel table
with one code per row.
MGWM_Applications_Query is the first query, where Access has pulled the
averages together for the one code.
[Count] is the Field in the Code_Table that holds the total count of
applications with that code.
"Count of MGWM Applications" is the automatically-generated field name
for Access's count of MGWM Applications.
Code is the field in the Code_Table that holds all of the 4-character
codes, like MGWM.
Here is the error I am getting: "Access did not update one field due to
a type conversion failure."
The field type for the Count of MGWM Applications is "General Number,"
and the field type for "Count" is "Number." What am I doing wrong?
By the way, if I replace all the code referencing the first query, and
just tell it to update Code_Table.Count as "2" where
Code_Table.Code="MGWM," it works.
Help! Am I trying to do the impossible, or am I just doing the really
hard incorrectly?
Thank you!
-Aaron