endy
endy

Reputation: 15

Can I freeze a form element with radio button?

I'd like to freeze/lock my form element, when my radio button checked.

Is it solve with one database row? Should I use VBA scripting to do this?

freeze form element

Upvotes: 0

Views: 60

Answers (1)

Gustav
Gustav

Reputation: 55921

A radio button is not for checking; that's what a CheckBox is for.

So, use a CheckBox and this code in the AfterUpdate event of this:

Private Sub YourCheckBox_AfterUpdate()

    Dim Frozen As Boolean

    Frozen = Nz(Me!YourCheckBox.Value)

    Me!YourTextBox.Locked = Frozen
    Me!YourTextBox.Enabled = Not Frozen

End Sub

Upvotes: 1

Related Questions