Option/Checkbox Issue (1 Viewer)

Sazed

New member
Local time
Today, 14:09
Joined
Jul 19, 2020
Messages
18
a potential problem with that code is if records are not entered in the right order

You are trying to apply excel type methodology to your problem, not a database one, so for me, it is not a way I would want to go. Good luck with your project
Please don't give up as we are almost there to solve it. I just want one simple thing to ensure that all the other records Stock checkboxes within the same Serial Number get automatically unchecked as soon as I click on any record's Stock checkbox within the sane serial number.
 

June7

AWF VIP
Local time
Today, 03:09
Joined
Mar 9, 2014
Messages
5,470
Again, instead of saving this value it can be calculated when needed.

But let us know how the UPDATE action works out.

A redesign would avoid the need altogether. Did you read post #9?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:09
Joined
Feb 19, 2013
Messages
16,607
please direct me to the right database way.
see post #6 - but as I said before, I suspect the data you have provided is incomplete - I suspect the date field includes a time element - it is just your format is hiding the time.

I presume 'camp office' is the store - the way your data example works, Alphi cannot return the tacho on the same day. Similarly camp office cannot issue to another person on the same day as they receive it back from someone else - unless there is a time element you are hding
 

Cronk

Registered User.
Local time
Today, 21:09
Joined
Jul 4, 2013
Messages
2,772
A time element is not required if June's suggestion of a return date field is used (and if the order of lending on a specific day is not required).
 

Sazed

New member
Local time
Today, 14:09
Joined
Jul 19, 2020
Messages
18
see post #6 - but as I said before, I suspect the data you have provided is incomplete - I suspect the date field includes a time element - it is just your format is hiding the time.

I presume 'camp office' is the store - the way your data example works, Alphi cannot return the tacho on the same day. Similarly camp office cannot issue to another person on the same day as they receive it back from someone else.
The table has no time field. And sometimes more than one transaction of the same Serial Number happens in the same say. So the max() doesn't give expected result all the time. So I added the Stock Checkbox field to check it manually.
 

Sazed

New member
Local time
Today, 14:09
Joined
Jul 19, 2020
Messages
18
In a same day, multiple transections of the same serial number happen somtimes. So the max() is not dependable.
 

Sazed

New member
Local time
Today, 14:09
Joined
Jul 19, 2020
Messages
18
No
see post #6 - but as I said before, I suspect the data you have provided is incomplete - I suspect the date field includes a time element - it is just your format is hiding the time.

I presume 'camp office' is the store - the way your data example works, Alphi cannot return the tacho on the same day. Similarly camp office cannot issue to another person on the same day as they receive it back from someone else - unless there is a time element you are hding
No time element in the date field.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:09
Joined
Feb 19, 2013
Messages
16,607
In that case suggest set the date field to include the time - use the now() function rather than the date() function.

I'm going to drop off this thread now, if you want a manual solution the one already provided is the best one going, but it will also have it's problems as already indicated.
 

Sazed

New member
Local time
Today, 14:09
Joined
Jul 19, 2020
Messages
18
In that case suggest set the date field to include the time - use the now() function rather than the date() function.

I'm going to drop off this thread now, if you want a manual solution the one already provided is the best one going, but it will also have it's problems as already indicated.
The date is manually entered. So how to include the time element?
 

June7

AWF VIP
Local time
Today, 03:09
Joined
Mar 9, 2014
Messages
5,470
If records are entered on day of transaction, can set DefaultValue property to Now(). Otherwise, entering date/time is tedious for user. Enter by typing each character in date/time field. Could try InputMask. Or use unbound textbox for each date/time part and code puts them together to save as a single date/time value.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:09
Joined
Sep 21, 2011
Messages
14,269
If records are entered on day of transaction, can set DefaultValue property to Now(). Otherwise, entering date/time is tedious for user. Enter by typing each character in date/time field. Could try InputMask. Or use unbound textbox for each date/time part and code puts them together to save as a single date/time value.
Could one add TimeValue() of Now() to date entered into the textbox?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:09
Joined
Feb 19, 2013
Messages
16,607
you can create a nominal time by dividing the ID by 86400. In the afterupdate of the transaction date field put

me.transaction_date=me.transaction_date+(me.ID/86400)

That will keep the order of entry on a per date basis - you need the mod in case ID goes over 86400

?date+(1 mod 86400)/86400
19/07/2020 00:00:01
?date+(2 mod 86400)/86400
19/07/2020 00:00:02
 

Users who are viewing this thread

Top Bottom