Read Only Records or ???

Randix

Registered User.
Local time
Today, 19:24
Joined
Mar 24, 2001
Messages
56
If I'm allowing a user to access the records of a table in a form, but want the ability to "turn" on or off particular records, eg so they are "read" only to the user (eg particular records of a table whose status I want to easily change from time to time), what's the easist way to do that? I don't want to make the entire table read only, and I don't want to make the form read only, just particular records. Also, and sorta related, is there any easy way to password protect particular records and/or fields? Thanks!
 
Private Sub Form_Current()
If [MyField] = "Whatever" Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If

hth
 
Private Sub Form_Current()
If [MyField] = "Whatever" Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If

hth
 
KevinM...thank you very much, your suggestion was perfect. Steve
 
You're welcome (sorry for double posting!)

As for password protecting individual records, I don't think you can. The best you can do with Access is use 'User Level Secirity' which goes down to object level protection. But from here you can use queries to restrict your data first and base forms on these and then deny users permissions on the table, but give them permissions on the query instead.

HTH
 
Ok, when I'm accessing a table that is not joined and i add..

Private Sub Form Current()
If [Control] = "X" Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If
End Sub

where "Control" refers to a field in the table that the form is oriented to, I have no problem and it works grrrrrreat, perfect.

But after hours of frustration, when I try to incorporate the same exact code on another form that happens to join the above table with another table called "audit", and where i try to reference the new field which also happens to be known as "Control" in that second table, i consistently keep getting an error message number "2465" which says Microsoft Access can't find the field "audit" referred to in your expression". I've tried [audit].control, [audit]![control] and every combination, and can't get it to work...can you give me a clue what I'm obviously doing wrong? Is the fact that this new form is based on two joined tables, requiring something special how I reference the field in this instance of how I'm inserting the code?
 
Ok, gawd decided s/he has caused me enuf grief on this one...i figured it out...thanks for the outlet in any event!
 

Users who are viewing this thread

Back
Top Bottom