Senin, 29 Desember 2025

Re: [MSAccessProfessionals] Add lock key to records..

For a very (too?) simple implementation you can review the Northwind 2 Developer Edition template. Orders have Status, and orders with a Closed status cannot be modified.

 

-Tom.

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of michael simpson via groups.io
Sent: Sunday, December 28, 2025 11:20 AM
To: msaccessprofessionals@groups.io
Subject: [MSAccessProfessionals] Add lock key to records..

 

I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  

My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

 

Can I use both Before and After update procedures, 

 

Is there a better way to lock down records. 

 

Take care,

Mike the Plumber

Sac City Plumbing

 

._,_._,_

Re: [MSAccessProfessionals] Add lock key to records..

For a very simple implementation you can review the Northwind 2 Developer Edition template. Orders have Status, and orders with a Closed status cannot be modified.

 

-Tom.

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Mark Burns via groups.io
Sent: Monday, December 29, 2025 8:44 AM
To: MSAccessProfessionals@groups.io; michael simpson via groups.io <saccity101=yahoo.com@groups.io>
Subject: Re: [MSAccessProfessionals] Add lock key to records..

 

Michael,

 

We would need more information on your overall solution architecture to give really complete answers on this kind of question.
For example:
Are you 100% MS-Access here (meaning, the data isn't stored to SQL Server or another BE database)? (SQL Server and other DBs make Triggers and other options available, as another avenue to work this issue.)
Are there perhaps more complex business rules around potential accounting issues in play? (an example may be issues surrounding bulk payments for multiple invoices over time...or, "no we indicated we wanted to pay These other invoices...not that invoice, because there an ongoing dispute over some item." - those sorts of issues which could require "unlocking and un-paying" some invoices later in time).
For a purely MS-Access approach, I'd remind you that Data Macros are available (sort of trigger-like Macros that work at the DBEngine level) that could work using a Locked flag at the record level to prevent table reads/writes depending on the logic flow implemented. (For example, are the invoice detail rows locked individually, or is the locked flag only at the invoice level? - This would affect the Data Macro designs.)

 

Regards,
Mark B.

On 12/28/2025 1:20 PM EST michael simpson via groups.io <saccity101=yahoo.com@groups.io> wrote:

 

 

I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  

My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

 

Can I use both Before and After update procedures, 

 

Is there a better way to lock down records. 

 

Take care,

Mike the Plumber

Sac City Plumbing

 

._,_._,_

Re: [MSAccessProfessionals] Add lock key to records..

Michael,

I may need to elaborate on my thoughts a bit.
A Locked flag in the data records itself may be meaningless by itself.
If your business rules state that an invoice needs to be locked to prevent unwanted database changes, this is a security-level requirement.
That means it needs to be enforced at the DBEngine level, and not at an application level.
Therefore, the Form-level code is the wrong place to put this type of logic.

The reason for this is that by itself the Lock flag means nothing to the database engine.

So, if you put code into the application to prevent writing data to a "locked" invoice's details, what's to prevent you or any power user from opening the data table directly in an editable view and changing the data that way (or, for that matter, via a vbscript or external code method)? Nothing - is the short answer. The DBEngine will just do the changes - no matter what your business rules say to the contrary.

This is both good and bad, but it makes for an unprovable audit trail, at the very least, or unwanted and unauthorized data changes, at worst.
 
This is why security-related rules like you're discussing need to be enforced at the database engine level, and not at an application level; so they actively prevent unwanted and unauthorized data changes, no matter the source or the change request.
 
Regards,
Mark B.
 
On 12/28/2025 1:20 PM EST michael simpson via groups.io <saccity101=yahoo.com@groups.io> wrote:
 
 
I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 
 
Can I use both Before and After update procedures, 
 
Is there a better way to lock down records. 
 

Take care,

Mike the Plumber

Sac City Plumbing

 

._,_._,_

Re: [MSAccessProfessionals] Add lock key to records..

Michael,
 
We would need more information on your overall solution architecture to give really complete answers on this kind of question.
For example:
Are you 100% MS-Access here (meaning, the data isn't stored to SQL Server or another BE database)? (SQL Server and other DBs make Triggers and other options available, as another avenue to work this issue.)
Are there perhaps more complex business rules around potential accounting issues in play? (an example may be issues surrounding bulk payments for multiple invoices over time...or, "no we indicated we wanted to pay These other invoices...not that invoice, because there an ongoing dispute over some item." - those sorts of issues which could require "unlocking and un-paying" some invoices later in time).
For a purely MS-Access approach, I'd remind you that Data Macros are available (sort of trigger-like Macros that work at the DBEngine level) that could work using a Locked flag at the record level to prevent table reads/writes depending on the logic flow implemented. (For example, are the invoice detail rows locked individually, or is the locked flag only at the invoice level? - This would affect the Data Macro designs.)
 
Regards,
Mark B.
On 12/28/2025 1:20 PM EST michael simpson via groups.io <saccity101=yahoo.com@groups.io> wrote:
 
 
I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 
 
Can I use both Before and After update procedures, 
 
Is there a better way to lock down records. 
 

Take care,

Mike the Plumber

Sac City Plumbing

 

._,_._,_

Minggu, 28 Desember 2025

Re: [MSAccessProfessionals] Add lock key to records..

Happy to help! Now stop sending snow over the hill for a bit, will ya? 😁

Paul
Sent via mobile device

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of michael simpson via groups.io <saccity101=yahoo.com@groups.io>
Sent: Sunday, December 28, 2025 1:26:30 PM
To: msaccessprofessionals@groups.io <msaccessprofessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Add lock key to records..
 
Perfect, thank you so much..
I am so glad that I asked questions.. 

Take care,

Mike the Plumber

Sac City Plumbing


On Sunday, December 28, 2025 at 10:58:02 AM PST, Paul Baldy via groups.io <pbaldy=gmail.com@groups.io> wrote:


My first thought is to toggle the Allow Edits property of the form based on that field, in the current event. 

Paul
Sent via mobile device

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of michael simpson via groups.io <saccity101=yahoo.com@groups.io>
Sent: Sunday, December 28, 2025 10:20:23 AM
To: msaccessprofessionals@groups.io <msaccessprofessionals@groups.io>
Subject: [MSAccessProfessionals] Add lock key to records..
 
I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

Can I use both Before and After update procedures, 

Is there a better way to lock down records. 

Take care,

Mike the Plumber

Sac City Plumbing


._,_._,_

Re: [MSAccessProfessionals] Add lock key to records..

Perfect, thank you so much..
I am so glad that I asked questions.. 

Take care,

Mike the Plumber

Sac City Plumbing


On Sunday, December 28, 2025 at 10:58:02 AM PST, Paul Baldy via groups.io <pbaldy=gmail.com@groups.io> wrote:


My first thought is to toggle the Allow Edits property of the form based on that field, in the current event. 

Paul
Sent via mobile device

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of michael simpson via groups.io <saccity101=yahoo.com@groups.io>
Sent: Sunday, December 28, 2025 10:20:23 AM
To: msaccessprofessionals@groups.io <msaccessprofessionals@groups.io>
Subject: [MSAccessProfessionals] Add lock key to records..
 
I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

Can I use both Before and After update procedures, 

Is there a better way to lock down records. 

Take care,

Mike the Plumber

Sac City Plumbing


._,_._,_

Re: [MSAccessProfessionals] Add lock key to records..

My first thought is to toggle the Allow Edits property of the form based on that field, in the current event. 

Paul
Sent via mobile device

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of michael simpson via groups.io <saccity101=yahoo.com@groups.io>
Sent: Sunday, December 28, 2025 10:20:23 AM
To: msaccessprofessionals@groups.io <msaccessprofessionals@groups.io>
Subject: [MSAccessProfessionals] Add lock key to records..
 
I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

Can I use both Before and After update procedures, 

Is there a better way to lock down records. 

Take care,

Mike the Plumber

Sac City Plumbing


._,_._,_

[MSAccessProfessionals] Add lock key to records..

I would like to add a lock to records once an invoice is sent out.. to prevent accidental changes.  
My first thought is to add a field (Lock) to each record and then add a before update procedure on each field, many of the fields also have after update procedures, 

Can I use both Before and After update procedures, 

Is there a better way to lock down records. 

Take care,

Mike the Plumber

Sac City Plumbing


._,_._,_

Senin, 08 Desember 2025

Sabtu, 06 Desember 2025

Re: [MSAccessProfessionals] Conditional Number formating

The solution I have seen at a former employer was to have a second field to store the precision (# of decimal places). 

Duane
Sent from my mobile

On Dec 5, 2025, at 9:18 AM, Jane via groups.io <jcross=crossproducts.plus.com@groups.io> wrote:


Hi
I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 
eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 
Any suggestions?
Many thanks
Jane

Jumat, 05 Desember 2025

Re: [MSAccessProfessionals] Conditional Number formating

Hi Jane,

 

In some cases, it is OK to store a number as text, and then use it in numerical calculations. VBA or the Access Expression Service (if using a query) will do the type coercion for you.

Example:

Dim d As Double

Dim s As String

s = "10.50"

d = s + 1

Debug.Print d

 

This will print the number 11.5

 

You can also write the calculation as:
d = CDbl(s) + 1

This makes the type coercion explicit. That would be my preference.

 

If for some reason this is not good enough for you, then consider adding a text field to the table for the user-entered string, and turn the current numeric field into a Calculated field with the expression:
CDbl([yourTextField])

 

Best Regards,

 

-Tom van Stiphout.

Microsoft Access MVP

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Jane via groups.io
Sent: Friday, December 5, 2025 8:19 AM
To: MSAccessProfessionals@groups.io
Subject: [MSAccessProfessionals] Conditional Number formating

 

Hi

I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 

eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 

Any suggestions?

Many thanks

Jane

[MSAccessProfessionals] Conditional Number formating

Hi
I have a numeric field (double), which I need to save/ display exactly according to how the user entered it.  I don't want to change it to a text field as the system does use it for calculations. Also general formatting to 2dp for example will show all numbers the same. 
eg 

User Enters

Currently Displays

Required Display

10.50

10.5

10.50

11

11

11

10.0

10

10.0

 
Any suggestions?
Many thanks
Jane
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116717) | Reply to Group | Reply to Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Senin, 01 Desember 2025

Re: [MSAccessProfessionals] Different data in same column

Good morning Duane,

 

Yes, I was able to use a crosstab query as suggested.  Thanks for reaching out. 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of Duane Hookom via groups.io
Sent: Monday, December 1, 2025 6:40 AM
To: MSAccessProfessionals@groups.io
Subject: Re: [MSAccessProfessionals] Different data in same column

 

Doyce, Is there any follow-up to your question? Did you get the assistance you needed? Duane From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

ZjQcmQRYFpfptBannerEnd

Doyce,

Is there any follow-up to your question? Did you get the assistance you needed?

 

Duane


From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>
Sent: Monday, November 17, 2025 4:02 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Different data in same column

 

The "new" format is the most useful since it's normalized. You can create a crosstab query with the pay code as the column heading. The employee ID and I expect a date filed will be the Row Headings and Sum of hours as the value. 

 

Duane

 



On Nov 17, 2025, at 2:19PM, Doyce Winberry via groups.io <doyce.winberry=xpo.com@groups.io> wrote:



Friends,

 

We have a new timekeeping system and I'm used to importing hours from the old system into a database where it can be sliced, diced, grouped, and etc.  Unfortunately, now when I'm running a report to extract the hours, there are so many types of paycodes used that the report puts all the paycodes in same column and the hours associated with each paycode in another "shared" column instead of making a column for each paycode and putting the hours in the correct column.  See examples:

This is the report I get.

Employee ID

Paycode

Total Hours

30252579

PTO Scheduled Current Year

3.50

30252579

Regular

36.57

30244320

Overtime

0.20

30244320

Regular

40.00

30250342

Regular

40.00

30250342

Overtime

0.18

30079782

Overtime

0.38

30079782

Regular

40.00

30268802

Regular

40.00

30268802

Overtime

0.33

 

This is how I want the data with 1 line per employee ID:

Employee ID

Regular

OverTime

PTO

30252579

36.56667

3.5

30244320

40

0.2

30250342

40

0.183333333

30079782

40

0.383333333

30268802

40

0.333333333

 

Are there any easy ways to do this?  My thoughts are to query the top table with If statements to then use a totals query on the first query to put all the records into one row.    

 

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

Re: [MSAccessProfessionals] Different data in same column

Doyce,
Is there any follow-up to your question? Did you get the assistance you needed?

Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom via groups.io <duanehookom=hotmail.com@groups.io>
Sent: Monday, November 17, 2025 4:02 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Different data in same column
 
The "new" format is the most useful since it's normalized. You can create a crosstab query with the pay code as the column heading. The employee ID and I expect a date filed will be the Row Headings and Sum of hours as the value. 

Duane


On Nov 17, 2025, at 2:19 PM, Doyce Winberry via groups.io <doyce.winberry=xpo.com@groups.io> wrote:



Friends,

 

We have a new timekeeping system and I'm used to importing hours from the old system into a database where it can be sliced, diced, grouped, and etc.  Unfortunately, now when I'm running a report to extract the hours, there are so many types of paycodes used that the report puts all the paycodes in same column and the hours associated with each paycode in another "shared" column instead of making a column for each paycode and putting the hours in the correct column.  See examples:

This is the report I get.

Employee ID

Paycode

Total Hours

30252579

PTO Scheduled Current Year

3.50

30252579

Regular

36.57

30244320

Overtime

0.20

30244320

Regular

40.00

30250342

Regular

40.00

30250342

Overtime

0.18

30079782

Overtime

0.38

30079782

Regular

40.00

30268802

Regular

40.00

30268802

Overtime

0.33

 

This is how I want the data with 1 line per employee ID:

Employee ID

Regular

OverTime

PTO

30252579

36.56667

3.5

30244320

40

0.2

30250342

40

0.183333333

30079782

40

0.383333333

30268802

40

0.333333333

 

Are there any easy ways to do this?  My thoughts are to query the top table with If statements to then use a totals query on the first query to put all the records into one row.    

 

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269