By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Trap click

P: n/a
Hi all!

I keep the subform locked until certain fields in the main for is filled
in. Is it possible to trap if the user clicks a field in a subform that is
locked.

Sigurd
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
If the field was called MyField . . .

If Me.MyField.Locked = True Then
MsgBox "This field is locked."
End If

Nigel
I keep the subform locked until certain fields in the main for is filled
in. Is it possible to trap if the user clicks a field in a subform that is
locked.

Sigurd

Nov 12 '05 #2

P: n/a
sorry - forgot to include . . .

Add this code to the GotFocus event

Private Sub MyField_GotFocus()
If Me.MyField.Locked = True Then
MsgBox "This field is locked."
End If
End Sub
Nov 12 '05 #3

P: n/a

"Nigel Lawrance" <na*@exeter37.freeserve.co.uk> wrote in message
news:bj**********@newsg4.svr.pol.co.uk...
It seems like the locked control or subform don't react to anything, it is truly locked. Have tryed both got_focus and mouse_down event with same
result. Are you sure this is working?


Yes it works fine on my form.

When you say the subform is locked - what do you mean exactly?
Also, are the fields set to Enabled False?

I suggested GotFocus so that if you tabbed OR clicked into the field it
would tell you if it was locked.
You could use the OnClick event if you wanted to trap when someone clicked
into the field.

Can you click into the field at all?

Nigel

It seems like i have used enabled=false in addition to locked=true. When I
change this it works like you say. Thanks again

Sigurd
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.