A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to display a message when current record is locked?



 
 
Thread Tools Display Modes
  #1  
Old March 3rd, 2008, 03:02 PM posted to microsoft.public.access.forms
Marco
external usenet poster
 
Posts: 535
Default how to display a message when current record is locked?

how can I put a message when current record is locked?

sometimes users don't realise that the record is already being used so I
think that a message alerting them was perfect.

How can i do this?

Regards,
Marco
  #2  
Old March 3rd, 2008, 04:50 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default how to display a message when current record is locked?

Marco,
What method are you using to "Lock" the record?
If some property, or form value, denotes "locked", the use the OnCurrent
event of the form to examine that property or value, and post the Locked
message when applicable.

Ex. OnCurrent (aircode, using a form value)
If Me.LockStatus = "Locked" Then
' MsgBox here "Locked"
End If
OR...
Ex. OnCurrent (aircode, using form property)
If Forms!frmYourFormName.Form.AllowEdits = False Then
' MsgBox here... "Locked"
End If

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."



"Marco" wrote in message
...
how can I put a message when current record is locked?

sometimes users don't realise that the record is already being used so I
think that a message alerting them was perfect.

How can i do this?

Regards,
Marco



  #3  
Old March 3rd, 2008, 05:38 PM posted to microsoft.public.access.forms
Marco
external usenet poster
 
Posts: 535
Default how to display a message when current record is locked?

hello.

It did not worked.

it returns several erros.

regards,
Marco




"Al Campagna" wrote:

Marco,
What method are you using to "Lock" the record?
If some property, or form value, denotes "locked", the use the OnCurrent
event of the form to examine that property or value, and post the Locked
message when applicable.

Ex. OnCurrent (aircode, using a form value)
If Me.LockStatus = "Locked" Then
' MsgBox here "Locked"
End If
OR...
Ex. OnCurrent (aircode, using form property)
If Forms!frmYourFormName.Form.AllowEdits = False Then
' MsgBox here... "Locked"
End If

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."



"Marco" wrote in message
...
how can I put a message when current record is locked?

sometimes users don't realise that the record is already being used so I
think that a message alerting them was perfect.

How can i do this?

Regards,
Marco




  #4  
Old March 3rd, 2008, 06:09 PM posted to microsoft.public.access.forms
DanRoss
external usenet poster
 
Posts: 27
Default how to display a message when current record is locked?

The "database" engine takes care of that type of locking on it's own and
it's pretty much transparent - however - if that conflict does occur the DB
engine will raise an error to the user.

You can repro by creating two simple queiries against the same table.
Open one query and edit the field (dont' save)
Open the other and edit the same field and save
go back to the first recrod and attempt to save and you'll get a write
confilict error. . .

If that's enough then no worries - let the db engine do it's work. However,
I had a situation where I had form data that multiple users could work on -
My solution was to create a tracting table. My forms included events to
maintain the table so that if a user opened a form and clicked "Edit" an
entry was entered into the table that identifed the user and the data being
edited. If another user attempted to click edit - it would check for the
tracking table, find that another user was working on that records and alert
the second user that the record was being modified by user name, record id,
time, other relevant info to my project.

This worked well and was eventually ported over to a APS web project.
Bottom line is if you want functionality to manage that type of activity -
you need to think through the work flow scenarios you'll encounter and build
it in.

Food for thought.







"Marco" wrote in message
...
how can I put a message when current record is locked?

sometimes users don't realise that the record is already being used so I
think that a message alerting them was perfect.

How can i do this?

Regards,
Marco


  #5  
Old March 4th, 2008, 01:28 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default how to display a message when current record is locked?

Marco,
Your reply gives us no information at all.
We still don't know what method you are using to Lock the records. And
consequently, what method we'll need to "unlock" the records.

You wrote...
It did not worked.

That tells us nothing...

it returns several erros.

What errors?

How can we assist you without seeing your code. Cut & Paste your code
"exactly" in your replies.

Note: The "aircode" (or pseudo code) I suggested, is just an shorthand
example of the code to unlock a record. It is not exact, and does not
represent the actual syntax you'll need to unlock your record.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Marco" wrote in message
...
hello.

It did not worked.

it returns several erros.

regards,
Marco




"Al Campagna" wrote:

Marco,
What method are you using to "Lock" the record?
If some property, or form value, denotes "locked", the use the
OnCurrent
event of the form to examine that property or value, and post the Locked
message when applicable.

Ex. OnCurrent (aircode, using a form value)
If Me.LockStatus = "Locked" Then
' MsgBox here "Locked"
End If
OR...
Ex. OnCurrent (aircode, using form property)
If Forms!frmYourFormName.Form.AllowEdits = False Then
' MsgBox here... "Locked"
End If

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."



"Marco" wrote in message
...
how can I put a message when current record is locked?

sometimes users don't realise that the record is already being used so
I
think that a message alerting them was perfect.

How can i do this?

Regards,
Marco






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.