[AccessD] Recording Locking

Daniel Waters df.waters at outlook.com
Wed Jan 10 08:38:58 CST 2024


Perhaps put a timer on the Delete Confirmation dialog - 30 Seconds?  With a note on the dialog that the delete will be cancelled in 30 Seconds.

If the delete was cancelled automatically, then pop up a 2nd note to say that the delete was cancelled automatically after 30 seconds.  The 2nd note will stay up until closed by the user.

-----Original Message-----
From: AccessD <accessd-bounces+df.waters=outlook.com at databaseadvisors.com> On Behalf Of Ryan W
Sent: 10 January, 2024 08:35
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Recording Locking

Err.. well.. that method that still holds the records locked waiting on the confirmation prompt.... was hoping avoiding the default delete confirm dialog would bypass this.



On Wed, Jan 10, 2024 at 8:20 AM Ryan W <wrwehler at gmail.com> wrote:

> Well,
>   It  does look like I can override the default delete confirmation 
> msgbox and avoid having to use a separate command button.  I guess I'll tinker.
>
>
> https://learn.microsoft.com/en-us/office/vba/api/access.form.beforedel
> confirm(even)
>
>
>
>
> On Wed, Jan 10, 2024 at 8:17 AM Jim Dettman via AccessD < 
> accessd at databaseadvisors.com> wrote:
>
>>
>> I'd use the code.
>>
>> Delete confirmations is global.
>>
>> Jim.
>>
>> -----Original Message-----
>> From: AccessD On Behalf Of Ryan W
>> Sent: Wednesday, January 10, 2024 9:08 AM
>> To: Access Developers discussion and problem solving < 
>> accessd at databaseadvisors.com>
>> Subject: Re: [AccessD] Recording Locking
>>
>> Yes; that's the idea is to use code to run the delete after a msgbox 
>> (to replace deletion confirmations). But can I turn off delete 
>> confirmations just for this form, or just the global option? Or is my 
>> only option a delete command button, instead?
>>
>>
>>
>>
>> On Wed, Jan 10, 2024 at 8:05 AM Jim Dettman via AccessD < 
>> accessd at databaseadvisors.com> wrote:
>>
>> > I should have added to turn off delete confirmations, or you can do:
>> >
>> > Dim db As DOA.Database
>> >
>> > Set db = CurrentDb()
>> >
>> > With db
>> >   .Execute "DELETE * FROM xyz WHERE ????"
>> >   If . RecordsAffected = 0 Then
>> >      MsgBox "Error"
>> >   Else
>> >       Msgbox . RecordsAffected & " records deleted."
>> >   End If
>> > End With
>> >
>> > Set db = nothing
>> >
>> > Jim.
>> >
>> > -----Original Message-----
>> > From: AccessD On Behalf Of Jim Dettman via AccessD
>> > Sent: Wednesday, January 10, 2024 8:57 AM
>> > To: 'Access Developers discussion and problem solving'
>> > <accessd at databaseadvisors.com>
>> > Cc: Jim Dettman <jimdettman at verizon.net>
>> > Subject: Re: [AccessD] Recording Locking
>> >
>> > Think you've summed it up nicely.
>> >
>> > That's the way it works.
>> >
>> > Jim.
>> >
>> > -----Original Message-----
>> > From: AccessD On Behalf Of Ryan W
>> > Sent: Wednesday, January 10, 2024 8:43 AM
>> > To: Access Developers discussion and problem solving 
>> > <accessd at databaseadvisors.com>
>> > Subject: [AccessD] Recording Locking
>> >
>> > Hey all,
>> >
>> > I had an interesting situation I don't think I've encountered before:
>> >
>> > I had a user come to me the other day and said they couldn't run 
>> > one of
>> the
>> > calculation command buttons. I ran it and got a query timeout.
>> >
>> > I checked for blocking SPIDs and found the one blocking this.  I 
>> > went
>> back
>> > to that workstation and the user had highlighted rows from a 
>> > datasheet
>> and
>> > pressed the delete key but left the deletion prompt up and walked away.
>> >
>> > This left a transaction open that was blocking other users from 
>> > modifying/inserting/deleting rows in the same tables, even if it 
>> > was unrelated data.  I'm guessing the primary key column(s) were 
>> > locked up
>> in
>> > all of this.  Once I hit OK or Cancel on that dialog prompt, the 
>> > system returned to normal.
>> >
>> > The only 'fix' I can think to come up with would be to make a 
>> > delete
>> button
>> > that uses a MsgBox and then runs the delete code on the selected 
>> > rows, since that would only run AFTER the MsgBox OK button is 
>> > pressed...  or
>> just
>> > tell my users "don't walk away from confirmation dialogs".
>> >
>> > Anyone got any words of wisdom on this?
>> > --
>> > AccessD mailing list
>> > AccessD at databaseadvisors.com
>> > https://databaseadvisors.com/mailman/listinfo/accessd
>> > Website: http://www.databaseadvisors.com
>> >
>> > --
>> > AccessD mailing list
>> > AccessD at databaseadvisors.com
>> > https://databaseadvisors.com/mailman/listinfo/accessd
>> > Website: http://www.databaseadvisors.com
>> >
>> > --
>> > AccessD mailing list
>> > AccessD at databaseadvisors.com
>> > https://databaseadvisors.com/mailman/listinfo/accessd
>> > Website: http://www.databaseadvisors.com
>> >
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> https://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> https://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
--
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list