Avatar billede gerifix28 Nybegynder
09. januar 2008 - 16:01 Der er 12 kommentarer og
1 løsning

Lagerstyring af flasker med differenceret indhold

Hej Eksperter

Spørgsmålet går kort og godt ud på følgende:
I en forespørgsel har jeg følgende:
OrdreID    FlaskeId Brugt dato Netto Kg Brugt kg    Status
37    39    21-09-2007    11    1    10
44    39    21-11-2007    11    0,5    10,5
45    39    24-11-2007    11    10    1
46    39    21-12-2007    11    6    5
6    40    11-03-2007    20    1    19
15    40    30-04-2007    20    0,5    19,5
22    40    17-07-2007    20    2    18

Som det ses har jeg flere ordrer, men få flasker der er fyldt med
netto kg vand, vandet bruges flere forskellige datoer med forskellige kg intervaler. Status er en udregnet netto-brugt formel der virker, men status/netto beholdning bliver ikke reguleret og den ville jeg gerne have lavet - kan man det?

Mange hilsner Klaus V.
Avatar billede terry Ekspert
09. januar 2008 - 17:30 #1
Klaus, can explain what status/netto beholdning is otherwsie we dont know if its possible or not.

I can see that status is [Netto Kg] - [Brugt kg]
Avatar billede japping Nybegynder
09. januar 2008 - 23:16 #2
Det kan man godt. Jeg vil kunne give dig et tilbud på at løse opgaven hvis du er interesseret ?
Avatar billede terry Ekspert
10. januar 2008 - 09:10 #3
"..Jeg vil kunne give dig et tilbud på at løse opgaven .."! Maybe I missed something, is gerifix28 suggesting he wants to pay for a solution? If so then this question should be in another category, if not then we should wait and see if we can find a solution which is free.
Avatar billede Slettet bruger
10. januar 2008 - 11:02 #4
En løsning er at oprette en tabel ved hjælp af forespørgslen og globale variable. Der er et eksempel på dette, som er rimelig simpelt og temmelig tjekket, her:

http://www.blueclaw-db.com/download/running_sum_query.htm
Avatar billede gerifix28 Nybegynder
10. januar 2008 - 14:24 #5
Terry, thank you for your comment - i don´t want to pay for a solution.
imagine this: a bottle with 11 kg (flaskeID)and(netto), a order where there is used 1 kg(brugt kg) gives a (status) of 10 kg. These 10 kg are the (new netto kg).
Now comes the tricky part, a new order on the same bottle, now with a order of 0,5 kg, this should be from (new netto kg). = 9,5 kg.

Hilsen Klaus
Avatar billede terry Ekspert
10. januar 2008 - 15:44 #6
Klaus, I think the correct solution all depends on how you design the tables and how you interact with the user.

Lets say you have a table with Bottle types. In this table you would have the details such as weight.

Now I guess that you have many of the same type so you might also have another table which contains info on each bottle (type (from type table), Flakse ID) and any other information which is specific for a unique bottle.

Now you need another table where you register all of the movements which you show in the example in your original question. NOTE I have reomved some of the fields because these come from another table or are calculated.

OrdreID, FlaskeId, [Brugt dato], [Brugt kg]

If you enter the inoformation in a form then you could show the bottle information on the main form and the movements in a sub form. On the main form you would see the [Netto Kg] taken from the Bottle Type table, and I would suggest that in the Bottle table you have a field which reflects the status of the bottle. This field should get updated after each movement.

So you only have one field (in the bottle table) which shows the correct status [Netto Kg]. You could also have it in each movement record.

Depending on which method you want depends on the solution although they are very similar.

I can see how your data looks at the moment but I'm not sure how you enter the data or if its all in one table.

Hope that all makes sence
Avatar billede gerifix28 Nybegynder
10. januar 2008 - 15:54 #7
Terry do you have an email?
Avatar billede terry Ekspert
10. januar 2008 - 15:58 #8
ekspertenATsanthell.dk

AT = @
Avatar billede terry Ekspert
10. januar 2008 - 16:34 #9
I dont know if you have sent anything but I havent yet received anything
Avatar billede gerifix28 Nybegynder
11. januar 2008 - 11:39 #10
I have sent you an email Terry
Avatar billede terry Ekspert
13. januar 2008 - 12:09 #11
After looking at the dB the solution is to update [Netto Kg] each time a new order is made.

In the forms after Insert event


If MsgBox("Update Netto Kg?", vbQuestion + vbYesNo) = vbYes Then

    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE Beholdning SET [Netto Kg] = [Netto Kg] - " & Nz(Me.Brugt_kg, 0) & " WHERE FlaskeID = " & Me.FlaskeId
    DoCmd.SetWarnings True
   
    Me.Beholdning.Form.Requery
   
End If
Avatar billede gerifix28 Nybegynder
17. januar 2008 - 11:18 #12
Tak for hjælpen - jeg er i test mode på den så jeg vender tilbage ved andre...
Avatar billede terry Ekspert
17. januar 2008 - 12:57 #13
tak
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester