K
Karen
I'm trying to write a sample program that will give us the pricing as setup
in our business system.
What I have:
A SQL table (Prccode) in the business system database that I have linked to.
The table structure is as follows:
code_type, filler, startdate, enddate, pord,qty1,price,qty2,price,...
'filler' can contain one of the following: customer number/code, customer
number/product category, customer type/code, customer type/product category,
customer number only, code number only, customer type only, product category
only. The code_type tells us which of these to expect in filler. These
have to be searched in this order because if the customer number/code is
found we use that price code and stop looking and if it's not found we look
for customer number/product category, and so on.
What I need to do: I need to have the user enter the customer number, code,
product category, quantity ordered, and customer type, then lookup in
Prccode the record where filler is a combination of these. I was thinking I
would run a query looking for the customer number/code combination then if
nothing is found try customer number/product category and so on. I know how
to use docmd.openquery and run a query (I have a query working now that
shows me the record based on the customer number/code). What I don't know
is how to use the results of the query for anything except showing it on the
screen or in a form. I need to have the program look at the results of the
query and get the startdate and enddate to compare to the system date to see
if the price code is valid, then get the price based on the quantity ordered
that was entered. And if there are no results to the first query I need to
run the second and so on.
Can anyone give me a shove in the right direction on how to use the results
of the query?
Thank you for all of the help.
Karen
in our business system.
What I have:
A SQL table (Prccode) in the business system database that I have linked to.
The table structure is as follows:
code_type, filler, startdate, enddate, pord,qty1,price,qty2,price,...
'filler' can contain one of the following: customer number/code, customer
number/product category, customer type/code, customer type/product category,
customer number only, code number only, customer type only, product category
only. The code_type tells us which of these to expect in filler. These
have to be searched in this order because if the customer number/code is
found we use that price code and stop looking and if it's not found we look
for customer number/product category, and so on.
What I need to do: I need to have the user enter the customer number, code,
product category, quantity ordered, and customer type, then lookup in
Prccode the record where filler is a combination of these. I was thinking I
would run a query looking for the customer number/code combination then if
nothing is found try customer number/product category and so on. I know how
to use docmd.openquery and run a query (I have a query working now that
shows me the record based on the customer number/code). What I don't know
is how to use the results of the query for anything except showing it on the
screen or in a form. I need to have the program look at the results of the
query and get the startdate and enddate to compare to the system date to see
if the price code is valid, then get the price based on the quantity ordered
that was entered. And if there are no results to the first query I need to
run the second and so on.
Can anyone give me a shove in the right direction on how to use the results
of the query?
Thank you for all of the help.
Karen