I have the attached database which we can use as an example of what I am trying to achieve.
I have a main form called FrmOverview which has a TabControl item inside of it which has 2 Tabs - General Information and Reliability.
When a user creates a new record, the user has to input details in the General Information Tab and then the user moves onto the Reliability Tab to fill in data on that Tab.
I am working towards using a red/green rectangle to identify whether anything has been inputted into the Reliability Tab (currently triggered by Reliability PartID matching the General Information PartID (identified with the SubCoverInformation) using the following code on the FrmOverview OnCurrent Event and TabCtl12 OnChange Event:
However for my code to work properly, I need to have another bit of code in the FrmSubReliabilityProgramme Form which does a similar thing, but references the Me.FrmSubReliability.Form!PartID and Me.FrmSubCoverInformation.Form!PartID portions in a different way so that it works.
What modifications do I need to make to allow this to work in the FrmSubReliabilityProgramme OnCurrent Event?
I have a main form called FrmOverview which has a TabControl item inside of it which has 2 Tabs - General Information and Reliability.
When a user creates a new record, the user has to input details in the General Information Tab and then the user moves onto the Reliability Tab to fill in data on that Tab.
I am working towards using a red/green rectangle to identify whether anything has been inputted into the Reliability Tab (currently triggered by Reliability PartID matching the General Information PartID (identified with the SubCoverInformation) using the following code on the FrmOverview OnCurrent Event and TabCtl12 OnChange Event:
Code:
Private Sub Form_Current()
If Nz(Me.FrmSubReliability.Form!PartID, 0) = _
Nz(Me.FrmSubCoverInformation.Form!PartID, 0) And _
Trim(Me.FrmSubReliability.Form!Title & "") <> vbNullString _
Then
Me.Form!ReliabilityProgrammePresent = -1
Me.Form!ReliabilityProgress.BackColor = RGB(33, 255, 44)
Else
Me.Form!ReliabilityProgrammePresent = -0
Me.Form!ReliabilityProgress.BackColor = RGB(255, 43, 43)
End If
End Sub
Private Sub TabCtl12_Change()
If Nz(Me.FrmSubReliability.Form!PartID, 0) = _
Nz(Me.FrmSubCoverInformation.Form!PartID, 0) And _
Trim(Me.FrmSubReliability.Form!Title & "") <> vbNullString _
Then
Me.Form!ReliabilityProgrammePresent = -1
Me.Form!ReliabilityProgress.BackColor = RGB(33, 255, 44)
Else
Me.Form!ReliabilityProgrammePresent = -0
Me.Form!ReliabilityProgress.BackColor = RGB(255, 43, 43)
End If
End Sub
However for my code to work properly, I need to have another bit of code in the FrmSubReliabilityProgramme Form which does a similar thing, but references the Me.FrmSubReliability.Form!PartID and Me.FrmSubCoverInformation.Form!PartID portions in a different way so that it works.
What modifications do I need to make to allow this to work in the FrmSubReliabilityProgramme OnCurrent Event?