Base: setting up a home pantry dbase

Looking for advice, using the scanned  bar code give the product, then i want to use Box-ID to add a THT.Date. All in that box is that date. Now i pull some hair to think of a way for the form-OUT or IN  that has the (scanned) product to add the Box-ID so the total is + or - 1. So just item,s IN and OUT

Or am i on the wrong way ? As my experience was with databases with  a unique ITEM-ID, i have now years later something how do i do that.Specially no macro experience have, so this would be a nice try out.

Hi,

I am assuming that you're not using dbase as your database engine, and
that you just abbreviated database to dbase in the title of your
message. The dBase format supported by LibreOffice is rather limited in
terms of functionality, so I would hope that you are using another db
engine instead, such as the actual "per default" hsqldb engine included
with LO.

Looking for advice, using the scanned  bar code give the product, then i
want to use Box-ID to add a THT.Date. All in that box is that date. Now
i pull some hair to think of a way for the form-OUT or IN  that has the
(scanned) product to add the Box-ID so the total is + or - 1. So just
item,s IN and OUT

I'm not really sure I understand how you want a BoxID, which I presume
is a barcode, and therefore probably a text string, to be added to a
date string held in the THT.Date field, and arrive at a result of +1 or -1.

Again, if I have understood correctly, you want a result of a
calculation to be displayed in a form control that can be expressed as
either +1 or -1. You could in that case just as equally choose 0 or 1,
and then use a boolean or binary field (generally, these are TINYINT(1)
or CHAR(1) fields, to hold the result.

However, you still need to determine when the result of your addition
should be 0/1 or +1/-1 - this can only be achieved by calculation. This
other calculation could be achieved:

- by macro;
- by using a constraint (if the db engine supports that kind of constraint);
- by using a trigger (if the db engine supports that kind of trigger).

Alex

MY bad Alex indeed i was going to use the  hsqldb  or mariadb in time.I am using debian strech as OS. on a core2 2.3 GHz.

Let say beans  barcode 234   =  Item-ID  2    Going in box-ID 1 ,then the next item-ID 2 in box-ID 1  ETC. so you get a box-ID(x) = box-id(x) +1  but the braindrain i get  is How to get the selected box-ID  into the formula to add one item .And in a next formular to substract. It start simpel and then it look like i want the world to inventory. As stated its for some home use,more to stay busy in my retired years :slight_smile:

Hi,

Let say beans  barcode 234   =  Item-ID  2    Going in box-ID 1 ,then
the next item-ID 2 in box-ID 1  ETC. so you get a box-ID(x) = box-id(x)
+1  but the braindrain i get  is How to get the selected box-ID  into
the formula to add one item .And in a next formular to substract. It
start simpel and then it look like i want the world to inventory. As
stated its for some home use,more to stay busy in my retired years :slight_smile:

OK, so as I now understand it, you want a running total of all items
with a given Item-ID (hence the inventory aspect).

I would recommend that you read Robert Grosskopf's Base Guide and sample
MediaDB (there are 2 examples, one without macros, and one with macros)
- both relate to media stock management for a library facility, which
has an inventory aspect to it. You will probably find the elements of
what you are looking for in these examples.

Alternatively, you could look at the following from the OpenOffice.org
forum:

Sample InOut inventory database:
https://forum.openoffice.org/en/forum/download/file.php?id=24572

Discussion thread:
https://forum.openoffice.org/en/forum/viewtopic.php?f=13&t=83077

Good luck !

Alex

Hi Alex, lunixbox,

OK, so as I now understand it, you want a running total of all items
with a given Item-ID (hence the inventory aspect).

I haven't answered to this because I have problems to understand ...
Hope you are right.

I would recommend that you read Robert Grosskopf's Base Guide and sample
MediaDB (there are 2 examples, one without macros, and one with macros)
- both relate to media stock management for a library facility, which
has an inventory aspect to it. You will probably find the elements of
what you are looking for in these examples.

@lunixbox: You could also write a private mail to me with a little
example, which shows the problem. Have tried something with
ean13-barcode and barcode-scanners here for a library.

Regards

Robert

Both thank you, will keep my busy.