Activate Form section by combo box selection

cft

Registered User.
Local time
Today, 16:28
Joined
Dec 31, 2001
Messages
52
I have a Form in an A2K db related to Written Correspondence logging, tracking, and reporting. I need to activate certain fields based on the selection of the term "Complaint" or "Inquiry" from a combobox value list. "Complaint" needs to lock out "Inquiry" fields, and vice versa. Is there a way to lock out unnecessary fields based on this selection process? Any suggestions or assistance would be gratefully received.
 
On the After Update Event of your Combobox add the following for each field you want locked

me.nameoffield.locked = TRUE

Or if you want to make them invisible

me.nameoffield.visible = FALSE

Remeber to reset the fields back to their original state when you move to a new record. You can do this by adding the following to the On Current Event of the form:

Dim frm As Form
Dim ctl As Control

Set frm = Screen.ActiveForm
For Each ctl In frm.Controls
Select Case ctl.ControlType
Case acTextBox
ctl.Locked = False
End Select
Next ctl



HTH
 

Users who are viewing this thread

Back
Top Bottom