Hello guys,
I have a main form frmJob_TrackingAll with a subform,(set as continuous form) and linked via Situs_ID that acts as a tracking form for each status/phase of each parent record.
on the subform I have a combobox that lists the different status/phase for each parent record, and I also have a textbox (StatusTime) field where users will enter how many hours they spent in for that specific child record (status/phase). What we need to do though is disable StatusTime so users can't have the mistake in entering hours on a status that shouldn't have any hours spent on it.
I wrote this code:
InStChID is the dropdown name (which lists down all status)
What happens with this code though is once I choose a status from above (5,7,9,13) on the dropdown box, it disables all StatusTime textbox for all records in the subform...
As I am not that great in writing code (my biggest frustration) Is there a way that it only disables the child record that actually has the status above?
Any help is greatly appreciated.
Thank you
I have a main form frmJob_TrackingAll with a subform,(set as continuous form) and linked via Situs_ID that acts as a tracking form for each status/phase of each parent record.
on the subform I have a combobox that lists the different status/phase for each parent record, and I also have a textbox (StatusTime) field where users will enter how many hours they spent in for that specific child record (status/phase). What we need to do though is disable StatusTime so users can't have the mistake in entering hours on a status that shouldn't have any hours spent on it.
I wrote this code:
Code:
Private Sub InStChID_AfterUpdate()
If Me.InStChID = 5 Then
Me.StatusTime.Enabled = False
Else
If Me.InStChID = 7 Then
Me.StatusTime.Enabled = False
Else
If Me.InStChID = 9 Then
Me.StatusTime.Enabled = False
Else
If Me.InStChID = 13 Then
Me.StatusTime.Enabled = False
Else
If Me.StatusTime = 15 Then
Me.StatusTime.Enabled = False
Else
Me.StatusTime.Enabled = True
End If
End If
End If
End If
End If
End Sub
InStChID is the dropdown name (which lists down all status)
What happens with this code though is once I choose a status from above (5,7,9,13) on the dropdown box, it disables all StatusTime textbox for all records in the subform...
As I am not that great in writing code (my biggest frustration) Is there a way that it only disables the child record that actually has the status above?
Any help is greatly appreciated.
Thank you