Combine dynamic records in an MS Access table - ms-access

My company uses a barcode scanner to scan computers in rooms for inventory purposes. We scan a barcode on the door of the room and then scan a barcode on each computer.
I have created my own Access database that imports the records and then let us track our computers in each room and track additional non-inventory information about them - like type of computer (computer lab or Admin computer), date it was moved to another room, who the computer belongs to if it is an admin computer, etc. I would now like to scan each computer twice - one scan for the inventory code and one scan for the Dell Service Tag barcode.
I end up with a table that looks like this:
03/14/18,15:00:15,03,117SE
03/14/18,15:00:23,01,Z0820167
03/14/18,15:00:27,01,9MR8S52
03/14/18,15:00:34,01,Z0820168
03/14/18,15:00:39,01,9MQMS52
03/14/18,15:00:47,01,Z0820148
03/14/18,15:00:54,01,C6RLS52
03/14/18,15:02:29,01,Z0820138
03/14/18,15:02:32,01,C6RMS52
The 03 record is the room number scan from the barcode on the door
The 01 records alternate:
The first row is the Inventory Tag that starts with the Z
The next row is the Dell Service tag which varies.
The rows then continue on to the subsequent computers
I would like to combine the Inventory tag record and the Dell service tag record into one record for each computer. I can figure out the logic to determine what kind of record each record is (inventory or service tag) but I am unsure of:
How to take the inventory code from 1 record
Then take the same field from the second record that has the Service tag
Combine the records putting the dell service tag in a new field
Then moving onto the next set of records until the end of the table
I would like to end up with a table something like this:
Date Time Room Inventorytag Servicetag
03/14/18 15:00:15 117SE Z0820167 9MR8S52
03/14/18 15:00:34 117SE Z0820168 9MQMS52
03/14/18 15:00:47 117SE Z0820148 C6RLS52
03/14/18 15:02:29 117SE Z0820138 C6RMS52
I am limited by our corporate inventory guys on how the scanner is configured I can change the data format. I will import the data remove the dellservice tag records and then output the txt file in the format that they need for the inventory system.
So far I have done all of my data manipulation using VBA and SQL queries.
So I want to make this work. Any ideas!!

Related

Query with MS Access (Sort of BOM explorer)

in a database I have a main table with parts and related quantities in warehouse, and many little tables with parts and related quantities to mount the device (that is the single table name).
I wish to build a query that asks for the device name and gives me the codes and the quantities stocked in warehouse (and maybe a column with the difference between the requested qty and the available one in warehouse):
Do you think it's possible?

Copy a field from Access to use in another access object

I have a form that uses a query to open and display a specific customer info based on a customer ID that is manually entered by the user.
The form populates with the customer info from a table where the customer ID can only occur one time. A sub form opens below the customer info with a list of items owned by that customer from another table where the customer ID can occur many times but the items owned is limited by a unique Serial Number.
I have this form set to No Edits so someone does not hose up the original data.
I would like for the user to select a particular Owned Item / Serial Number, and have that SN copied and used to automatically populate another query to open a new work request on that SN.
I don't know if this is possible or not but if so some help with the code or macro would be most helpful.
I understand that using Ctrl C and Ctrl V are the simple answer but the people using this don't want the extra effort and in some cases it is beyond them to even that right.
Create a buttom in the subform and write there a code to start a new record with the same serial as the current record in the subform

Database Size Management

I am in the final stages of building my website and I am getting a little nervous that I am doing something wrong with my database.
I am building a Laravel/mysql site that allows users to add events. So I have an Event database. I allow users to choose dates for their event for next six months. That means one Event can have around 180 event dates which I save to a separate database called Shows. Each of those show dates can have tickets and the prices(vip, general etc) in a Ticket database. That means for just one event, it could create a huge number of entries.
event(1) -> show on every day(180) -> 5 ticket types(900 entries in my tickets database)
As far as I can tell this is the correct way to do it, but it seems like my Ticket database is going to get massive quickly. I will be using Elastic Search to filter through the data.

Microsoft Access database adding multiple row in form

I have created the database in access, to enter daily inspection data, some time for one item we have to add multiple type rework entry and for that every time we have to select product name every time, and its time consuming
what I am trying to find that add multi-row in my form which will store different types to data in separate rows in the main table and product name will take automatically for all rows data

Summing a ledger over long period of time. (reconciliation, snapshots, rolling sum?)

We are building a warehouse stock management system and have a stock movements table that records stock into, through and out of the system, for each product and each location it is stored. i.e.
10 units of Product A is received into Location A
10 units Product A are moved to Location B and removed from Location A.
1 unit is removed (sold) from Location B
... and so on.
This means that over to work out how much of each product is stored in each location we would;
"SELECT SUM('qty') FROM stock_movements GROUP BY location, product"
(we actually use Eloquent but I have used SQL for an example)
Over time, this will mean our stock movements table will grow to millions of rows and I am wondering the way to best manage this. The options I can think of:
Sum the rows as grouped above and accept it may get slow over time. Im not sure how many rows it will take before it actually starts to cause any performance issues. When requesting a whole inventory log via our API each row would have to be summed for every product, so this will compile to a fairly large calculation.
Create a snapshot of the summed rows every day/week/month etc. on a cron and then just add the sum of the most recent rows on the fly.
Create a separate table with a live stock level which is added to and subtracted with every stock movement. The stock movements table shows an entire history of all movements while the new table just shows the live amounts. We would use database transactions here to ensure they keep in sync.
Is there a defined and best practice way to handle this kind of thing already? Would love to hear your thoughts!
The good news is that your system is already where a lot of people say the database world should be moving: event sourcing. ES just stores every event against an object, in this case your location, and in order to get the current state you have to start with an empty object and replay all of that objects events.
Of course, this can be time-consuming, and your last two bullet points are the standard ways of dealing with it. First, you can create regular snapshots with the current-as-of-then totals for that location, and then when someone asks for the current-as-of-now totals you only need to replay events since the last snapshot. Second, you can have a separate table of current values, and whenever you insert a record into your event store you also update the current value. If they ever get out-of-sync, you can always start fresh and replay the entire event series again.
Both of these scenarios are typically managed through an intermediary queue service, like SQL's Service Broker, RabbitMQ, or Amazon's SQS: instead of inserting an event directly into your event store, you send the change into a queue and the code that processes the queue will update your snapshot.
Good luck!