update table based on criteria

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

Guest

Hi all

I think I'm in the right discussion for this question.... I currently have an append qry which adds data to an invdetails table from a sale order (issueing items). The cmd button is on the sale order form and will only append order items for that record. I would like to take it one step further (I need to take it one step further to meet client needs) so that the query will only run if there is enough stock to fill the whole order. i.e. right now, if there are 5 items on the order it issues for the 2 items that it has stock for. I would like to have a criteria so it wouldn't issue any stock for the order unless all 5 items can be accomodated - does that make sense or is more info needed? (I'd also like to be able to report on the items that are short for that order - I'm thinking a flag or something will be needed?) I can't make my way through it so if anyone has suggestions

Thank yo

Joan

ps to give you a little more background -it's sort of like a bom where all the items on the order are needed to build the end item (I don't deal with the end item for selling purposes) so unless all items are there, i don't want to issue/allocate.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just a guess -- The query would have something like:

....
HAVING COUNT(*) = Forms!FormName!CountOfRecs

Where CountOfRecords would be a control that would have the form's
Recordset.Count value.

Never tried that - not sure it will work.

Or, if you're not grouping or summing you'd have to have 3 queries:
one that would get the current available items and another that would
count the records returned by the first and the last to append the
items into the other table if the 2nd query's count is correct. This
would have to be controled in VBA under the CommandButton in order to
read the results of the 2nd query and continue with the 3rd query, or
not.

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQBbhsoechKqOuFEgEQJj0QCgnnG2gMwHFUYDkKSlDOwC8tgVvc4AoIy+
+ObLDsRCbiCYPqbTEQAFlVOp
=89NJ
-----END PGP SIGNATURE-----
 
Back
Top