Access 2016 Auto Increase Number then Reset to 1 - ms-access

First I apologize for any mistakes. I'm new to VBA.
I have a table (tblCustomers) with 3 fields that need to work together. The fields are JumpDate, Load, and Slot.
I am trying to have the Load and Slot increase from 1 to 12 as the orders are taken.
So If the JumpDate is equal to what is entered and Load is equal to what is entered then Slot +1 of last record with same date and Load up to 12 then resets to 1. Once the Slot reaches 12 then Load should increase by 1 up to 12. If both Load and Slot = 12 then message "All Loads Filled"
I am sure there is a way to do this I'm just not sure how. Any help is appreciated.

Related

AG Grid React: based on last updated time how can I display running time(e.g. how many minutes ago data changed)

data: [{id:1, lastUpdatedTime: 23623636}]
let's say this record not changing in the back but on screen after first render I want to show last updated time as minute age, meaning as time goes by minute age(only that column) will increase like below (like we get older every seconds)
0 min
1 min
...
5 min etc
Display minute age instead of last updated and keep refreshing all the time

Detect duplicates on 2 attributes: nifi

I am trying using NIFI to detect duplicates based on 2 attributes of flow files such that per second there should not be any duplicate rows, whose 2 particular attribute values are same. In DetectDuplicate processor, following are the entries of my processor:
CacheEntryIdentifier : ${attribute1_name}::${attribute2_name}
Age of Duration : 1 sec
Distributed Chache Service : DistributedMapCacheClientService
Still, I am getting duplicate rows for which, per second values of these 2 attributes are same.
Help is much appreciated. Thanks.
An "Age Off Duration" of 1 second means that a CacheEntryIndentifier value that is a duplicate of one that arrived at least one second ago will NOT be considered a duplicate. That property is used to let entries "expire", some users set it for 24 hours so the next day, the same values can show up again as "not previously seen". If you want to always maintain the "seen" values, leave "Age Off Duration" blank.

Access Dynamic entry form

First off my Access skills are sub-par, but I'm fairly certain that it is the direction I need to go for my project so I'm hoping I can get some feedback to direct my research. I am however well versed at Excel, VBA and Matlab so I'm not completely incapable, I hope.
I need to assemble a system to track emissions (chemicals) from a variety of sources (units). Each unit has its own set of possible emissions and they need to be tracked daily (but also have the capability to be entered for multiple days at the same time).
What I would ideally like to have is an entry form that initially has 2 dropdown boxes, one to select the month/year and the other to select the unit.
Once selected I would like to auto populate a table that has the entire months dates in column 1, and then all of the possible emissions for that unit in the next 2:N columns. Then I would like to query the existing database to populate any data that has already been entered for the date/unit combination.
At this point need to let the users input new data, either for just one day or for numerous days. Then save it to the database.
I have approximately 70 possible emissions and approximately 40 units. I will need to be able to add new units and specify their chemicals as well as add new chemicals to existing units as their duties change. I would also like the ability for multiple users to be entering data simultaneously, which I believe is a hallmark of Access and may not be something I have to "turn on".
I hope that there is a way that Access can help me do this and not necessitate using Excel (which is very clunky in this case).
Thanks in advance,
Ben
The format for the data can simply be:
Date Unit Chemical1 Chemical2 Chemical3
1/1/16 UnitA 0 0.1 0
1/1/16 UnitB 0 0.3 0.2
1/1/16 UnitC 0.2 0 0.5
I'll need to do more analysis of the data, but given it as shown would be more than sufficient for the remainder of the work.
For the data entry from I would like to have two drop down boxes: (1) Month/Year and (2) Unit Name. And then the form that the users would fill in would list each day of the month in the left-most column and then give all of the chems that unit could emit in the following columns.
So if:
Unit1 was able to emit ChemA and ChemC
Unit2 was able to emit ChemB
Unit3 was able to emit ChemA, ChemB, and ChemC
So the entry form for Jan-2016 for Unit1 would give them the following assuming today is the 3rd and they have entered data for the 1 and 2.
(1)Jan-2016 (2)UnitA
Date ChemA ChemC
1/1 0.1 0.2
1/2 0.2 0.1
1/3
Then selecting unit 2 would change the available columns and again show the last 2 days entries and allow for the entry of today
(1)Jan-2016 (2)Unit2
Date ChemB
1/1 0.1
1/2 0.2
1/3
Finally Unit3 has all 3 chemicals available and would show the previous data and the blank entries.
(1)Jan-2016 (2)UnitB
Date ChemA ChemB ChemC
1/1 0.1 0.1 0.1
1/2 0.2 0.2 0.2
1/3
I don't mind (and would prefer) that all of the dates for a month were populated and not just the next date. So that January would have 31 rows, Feb would have 29 (this year), etc, etc.
01-21-2016
Wayne, my current tables are:
UnitList
ID UnitName UnitOwner UnitLocation UnitDesc AllowedChems
The last column AllowedChems, is a multiple selection that is linked to the table ChemicalList which looks like:
ID ChemicalName MassUnit Type
Where all of the entries from ChemicalName are possible selection in the AllowedChems field of UnitList
Then I have a table called Tracking with the columns:
ID EDate UName Vent ThOx
At the end of this list I would like to have a column for each of the chemicals listed in ChemicalList, that way the users can input a number for the mass of that chemical they are emitting and it will be transferred to the correct column. But I'm as yet unable to determine if I'm able to build columns by linking them to the contents of another table. Perhaps there is another way around this?
For example if my chemicals are listed in the ChemicalList table as:
ID ChemName
1 ChemA
2 ChemB
3 ChemC
Then I want the Tracking table to look like:
ID EDate UName Vent ThOx ChemA ChemB ChemC
And grow each time a new chemical is added.

setFirstResult() and Limit Failing in Ejb3.1

I have 10000 records in database i want to fetch 100 record first time next 100 record 2nd time and so on. I'm using setFirstResult() and maxResult(). I'm maintaining a counter to update set first result offset setFirstResult(count) is always started from first index whatever value you put inside it, it start from 0.
List<StudentBo> bos=manager.createNamedQuery("getAllApplicantForRegistration")
.setParameter("batch",dto.getBatch())
.setFirstResult(count)
.setMaxResult(lastIndex).getResultList();
setFirstResult will incease every time while setMaxResult will be static.

grab mysql result based on field values

I am taking over designing a CMS from another programmer. As the site is filling up, we're finding loops in mysql queries causing long hangs. I have found a temp solution for this one, but am wondering if there is a quicker way of doing it?
take the table (tracks resources):
id resource click
1 res_1 192
2 res_2 12
3 res_3 300
what we need to get is a popularity of the resource - res_click/total_click
what he had was a while loop:
while ($item = mysql_fetch_array ($result)) $total_clicks = $total_clicks + $item[0];
As there could be 100 or more resources to a page, this was running for each resource, and it is causing major hangs.
My solution is to get a sum:
SELECT SUM(click) FROM uri
SELECT click FROM resource WHERE id=$x
then divide them both.
But this two calls are still running for around a 100 items per page. Is there a way I can have a field in mysql that is the result of a formula based on another another, like in excell? So I could add a field "percentage", tell mysql that it is the sum of click divided by the current click value, then every time click is updated the 'percentage' field is automatically updated?
any help would be appreciated,
cheers ;)
you can create a view on your table that present the sum you want