G
Guest
I have a form with the following onopen event where [Stock_Availability] and
[Service_Availability] is a bound yes/no tick option - but I get erratic
results depending on which record is shown from the underlying table/query -
how can I get the code to react only to the record that is displayed? I get
erratic results on a new record aswell - should I be putting the code
somewhere else?
The code does work for the afterupdate event on the bound controls. Please
help, thanks,
Richard
Private Sub Form_Open(Cancel As Integer)
If Me.Stock_Availability = True Then
Me.Qty_Available.Enabled = True
Me.Unit_Price.Enabled = True
Me.Condition_Code.Enabled = True
Me.Stock_Notes.Enabled = True
Else: Me.Qty_Available.Enabled = False
Me.Unit_Price.Enabled = False
Me.Condition_Code.Enabled = False
Me.Stock_Notes.Enabled = False
End If
If Me.Service_Availablility = True Then
Me.Avg_Bench_Check.Enabled = True
Me.Avg_Repair_Cost.Enabled = True
Me.Avg_Overhaul_Cost.Enabled = True
Me.TAT.Enabled = True
Me.Service_Notes.Enabled = True
Else: Me.Avg_Bench_Check.Enabled = False
Me.Avg_Repair_Cost.Enabled = False
Me.Avg_Overhaul_Cost.Enabled = False
Me.TAT.Enabled = False
Me.Service_Notes.Enabled = False
End If
End Sub
[Service_Availability] is a bound yes/no tick option - but I get erratic
results depending on which record is shown from the underlying table/query -
how can I get the code to react only to the record that is displayed? I get
erratic results on a new record aswell - should I be putting the code
somewhere else?
The code does work for the afterupdate event on the bound controls. Please
help, thanks,
Richard
Private Sub Form_Open(Cancel As Integer)
If Me.Stock_Availability = True Then
Me.Qty_Available.Enabled = True
Me.Unit_Price.Enabled = True
Me.Condition_Code.Enabled = True
Me.Stock_Notes.Enabled = True
Else: Me.Qty_Available.Enabled = False
Me.Unit_Price.Enabled = False
Me.Condition_Code.Enabled = False
Me.Stock_Notes.Enabled = False
End If
If Me.Service_Availablility = True Then
Me.Avg_Bench_Check.Enabled = True
Me.Avg_Repair_Cost.Enabled = True
Me.Avg_Overhaul_Cost.Enabled = True
Me.TAT.Enabled = True
Me.Service_Notes.Enabled = True
Else: Me.Avg_Bench_Check.Enabled = False
Me.Avg_Repair_Cost.Enabled = False
Me.Avg_Overhaul_Cost.Enabled = False
Me.TAT.Enabled = False
Me.Service_Notes.Enabled = False
End If
End Sub