![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In a medical application, the client needs to lock the patient's daily record after a supervisor has reviewed and "signed" that day's input. Can I do that in Access? Can I do it without writing VBA? Nance |
#3
| |||
| |||
|
|
In a medical application, the client needs to lock the patient's daily record after a supervisor has reviewed and "signed" that day's input. Can I do that in Access? Can I do it without writing VBA? Nance |
#4
| |||
| |||
|
|
Nance wrote: In a medical application, the client needs to lock the patient's daily record after a supervisor has reviewed and "signed" that day's input. Can I do that in Access? *Can I do it without writing VBA? *Nance What version of Access are you using? In A2010, there is a new "data macro" feature that resembles triggers in other rdbms. That would allow you to write a "before" trigger that would check the field's value and either allow or rollback the transaction based on that value. This would prevent anyone from updating the record without first disabling the trigger, much more foolproof than the techniques you will be forced to use in pre-2010 versions. |
#5
| |||
| |||
|
|
The client who made the request uses Access 2003. I've tried the Me.allowedits = (me.Signedoff) but I don't understand the me.signedoff expression. I presumed that the boolean expression meant that I needed a yes/no field so I wrote a query, then a macro that updated a Yes/No field called "Approved" to Yes when the supervisor's name field was updated. Unfortunately, I don't know how to use that Approved field in the me.signedoff statement. More help, please! Nance |
#6
| |||
| |||
|
|
I'm not aware of any way to accomplish this without using VBA in Access 2003 and earlier. Assumptions: -- Control or field named SupervisorName -- SupervisorName is Text -- If SupervisorName is NOT blank then lock the record for editing Private Sub Form_Current() * *Me.AllowEdits = (Len(Me.SupervisorName & vbNullString)=0) End Sub (Len(Me.SupervisorName & vbNullString)=0) will return TRUE when SupervisorName is null or a zero-length string and FALSE in cases where there is at least one character in the field. *Replace supervisorName with the correct field/control name. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 11/30/2010 5:02 PM, Nance wrote: The client who made the request uses Access 2003. I've tried the Me.allowedits = (me.Signedoff) but I don't understand the me.signedoff expression. *I presumed that the boolean expression meant that I needed a yes/no field so I wrote a query, then a macro that updated a Yes/No field called "Approved" to Yes when the supervisor's name field was updated. *Unfortunately, I don't know how to use that Approved field in the me.signedoff statement. *More help, please! *Nance- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |