简体   繁体   中英

Access 2007 continuous form - only matching row editable

Good afternoon,

I've got a continuous form that displays records for any number of selected employees. I'd like for only that employee's row (or more specifically a particular text box in their row) be editable and no others.

I thought about doing something like this.

Private Sub Form_Load()
If Me.txtResponse <> [Forms]![Home].txtEmployeeName Then
 Me.txtResponse.Locked = True
End If
End Sub

and I get an error that I entered an expression that has no value - and it highlights the me.txtResponse.

I don't know if i'm barking up the wrong tree or if this is even possible in a continuous bound form. Any ideas?

Form_Load is too early for that code. Move it to the Form_Current event and it will run when first opened and again with each record navigation. You'll want to add

Else
    Me.txtResponse.Locked = False

in their to allow changes when a match is made.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM