Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation Rule and Security on Form

Status
Not open for further replies.

swaggel1

Technical User
Jun 19, 2001
34
US
I have a couple of questions regarding a form in an Access 2000 database. The form is very simple, consisting only of an ID field, a title associated with the ID, three date fields, a comment field, and a search button so that the user can bring up data associated with the ID number.

I used the Security Wizard to establish security on the database for two different groups. The group in question here has rights to change the data on the form but not the design of the form (I think it’s called Full Data rights).

The first thing I need to accomplish is to require that an entry be made in the comment field if the information in any of the three date fields is changed. I know you can use the Validation Rule to have a message box pop up stating that the information is required, but is there any way to keep the date information from updating if the comment field isn’t completed?

My second question involves security. I have the two security groups set up so that the one group can only update data. However, when they use their password to log into the database, they can view all of the reports, forms, etc. Is there any way that, once they log in, they can only see the one form they need to update, while the other group of users can still have full access to all the objects in the database?

Sorry if these are easy questions, but I’m still trying to learn…..Please respond with any suggestions. Thanks!
 
in reagards to you first question,

presumably you will have a form for the original creation of a record, then another form to view/amend records. (i say usually since its what i always do :p )

so on the amend form you could set the three date fields to be disabled by default, and then to enable once the comments box "is not null"

my coding knowledge is none existant, but nether the less i shall try

Private Sub comment field name_afterupdate()
If comment field.value = null Then

datefield1.Enabled = false
datefield2.Enabled = false
datefield3.Enabled = false

Else

If coment field.value = is not null Then
datefield1.Enabled = true
datefield2.Enabled = true
datefield3.Enabled = true

End If

End If

End Sub

that code prolly wont work, will need someone who knows what they are talking about to tweak.

not sure if "is null" and "is not null" are vb code, but thats the jiist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top