Locking text boxes and sub forms

J

James

Hello I can call the following module on some of my forms
which locks certain things and displayes a message.

----------------------------------------------------------
Option Compare Database
Public Warning As String
Sub SetWarning()
Warning = "You have got RESTRICTED access to edit
data."
End Sub
Sub Restrict(TheSubForm As Object, TheText As Object)
If UsrUserID = 3 Then
TheSubForm.Locked = True
TheTextBox.Locked = True
TheText.Caption = Warning
End If
End Sub
----------------------------------------------------------

How could I modify it so theat the message appears in red
and is bold? also I would like it to select all the
subforms and text boxes on the form and lock them all.
Could I also do the same thing but for a list box which
has values but not lock it but stop edits and things so
all you can do is click on a value and do the same with a
combo Box?

Many Thanks

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top