Hello Steve,
thanks... and i'm glad that I was able to make sense of things (or at least
a little bit). Yes, "sold" & "consignment" are properties of my frminvoice.
In your mentioning that it "goes against the grain to have the same
information in more than one place in the database". --> would you have a
better suggestion on how I should set it up. B/c right now this is what I
have in regards to orders/inventory/& invoices.
tblinventory -- contains all the inventory that I have, including Sold,
Consignment, & in my warehouse
tblinvoices - contains my sold & consignment invoices --> on sold items go
on a sold invoice and only consignment invoices go on a consignment invoice.
If an item from a consignment invoice is sold, I want to have it "removed"
from the consignment invoice and I will add it as a Sold Invoice.
tlbinvoicedetails--> contains information about each inventory item for
each invoice, including ordernumber, designname, size, etc.
frmvoices / frminvoicedetails subform --> from my frminvoices, the user
selects what type of invoice it is "sold" or "consignment" and assigns an
invoicenumber, then the user selects the client that is to be billed/shipped
to.
from that point the user goes to the order entry subform
(frminvoicedetails subform), and selects the item serialnumber from a
dropdown/lookup on my tblinventory. Once the serialnumber is selected the
following are filled in from the information in my tblinventory (size,
designname, designnumber, sqfeet, price).
I hope this is making some sense on how I am doing things and why I am
wanting my tblinventory to contain the invoicetype(rugstatus of sold or
consignment)? b/c otherwise, I have my tblinventory that contains all my
inventory, both warehouse, items I have added to my sold invoices, and items
that have been added to my consignment invoices. The problem that I am facing
and trying to solve is that once my invoice is created, I don't know (from my
tblinventory) who has what and what is on consignment & is sold since that
information is only held in my tblinvoicedetails.
I hope i'm not rambling on....
Please let me know if you have any questions...
I like the idea of the update query, but the problem with that or that I
have found with that, is that pesky nasty looking update query box comes up.
Can I get rid of that? Can I change it, to make it more useful?
thanks so much...
if need be you can email me and I can email you print screens of my
database form layouts / documenter info...
Brook
Steve Schapel said:
Brook,
Ah, I see. Thanks for the clarification, and sorry I misunderstood you
before. I now understand that each record in the tblinventory table is
a distinct object. And that it is appropriate for the status of each
piece (sold, consigned) to be recorded in this table. In this light, it
is now a question for me whether this sold/consigned data is really a
property of the invoice. Anyway, you obviously know your business
better that I could hope to imagine... it's just that it sort of goes
against the grain to have the same information in more than one place in
the database. Is it possible, theoretically at least, for an invoice to
include pieces being sold and other pieces being consigned?
Well, if you want an invoice to be recorded as an invoicetype Sold or
Consignment, and then have this value assigned to the invoiced items,
this can be done via an Update Query. I guess you would have to decide
at which point in the process you do this... when the invoice is
printed? The code would be something like this...
CurrentDb.Execute "UPDATE tblinventory INNER JOIN tblinvoicedetails ON
tblinventory.[serial#] = tblinvoicedetails.[serial#] SET invoicetype ='"
& me.invoicetype & "' WHERE tblinvoicedetails.[invoice#]=" &
Me.[invoice#], dbFailOnError
The other approach, as I intimated before, is to assign the status to
each inventory item at the point where it is added to an invoice, and
dispense with the invoicetype in the invoice table altogether.
By the way, on a complete tangent, it is not a good idea to use a # as
part of a field name.
--
Steve Schapel, Microsoft Access MVP
Steve,
Well, actually each piece could either be sold, in which that case, I
would like to pass invoicetype of "Sold" to the inventorytable from the
tblinvoice details and therefor would not be availabe as a choice to add to a
new invoice, or it could be out at a client on consignment, in that case I
would like to pass invoicetype of "Consignment" to the inventorytable from
the tblinvoice details and therefore, once the item is sold, a new "sales"
invoice is prepared and then the invoicetype would be updated to "Sold".
Also with this, my tblinventory, I would be able to perform reporting on
what items are sold and who to, what items are on Consignment and where they
are located.
Please let me know if this is still not clear and I will try to post more
information.
Brook