So here's the thing. I have a main form and a subform. I want the subform to "gather" the APPLICATION # from the main form, out of consistency so I created a master link. When I don't add any VBA code I get an error saying i'm trying to reference some VBA code. After poking around I found some VBA code that would be able to help me but it's not working.
When trying to use the following code I get the error "Method or data member not found"
Code:
Private Sub APPLICATION_AfterUpdate()
Forms![Quality Form]![Score Subform].Form!APPLICATION = Me!APPLICATION.Value
If DCount("*", "QUALITY_Table", "APPLICATION='" & Me.APPLICATION & "'") > 0 Then
Me.APPLICATION.ForeColor = vbRed
Cancel = True
Else
Me.APPLICATION.ForeColor = vbBlack
End If
End Sub
When I edit the same code to comment out some part like this:
Code:
Private Sub APPLICATION_AfterUpdate()
Forms![Quality Form]![Score Subform].Form!APPLICATION = Me!APPLICATION.Value
If DCount("*", "QUALITY_Table", "APPLICATION='" & Me.APPLICATION & "'") > 0 Then
'Me.APPLICATION.ForeColor = vbRed
'Cancel = True
Else
'Me.APPLICATION.ForeColor = vbBlack
End If
End Sub
I get a 438 error, but the field from the subform is updated to match the APPLICATION field I want as master link.
I don't really understand why it's not working and without any VBA code it's just not working.