Hi,
I have a (master) form in Single Form view. In this form I have a subform, which displays a list of other record that have the same GroupID as the record viewed in the master form. Obviously the list will also display the record viewed in the master form, so next to it i want to place something like a label "Currently open".
In the subform I created this lable and made it invisible, then I have a VBA script to check if the listed record matches the master record (using RecordID) and eventually make the label visible. The master RecordID is fetched from a global variable using the FetchRecordID() function.
I get the feeling I've done this completely wrong.
I used the Form_Current event of the subform to run the script and this is what it looks like:
The result is a list but none of the records have the "Currently open" label visible, but when I click on the record corresponding to the master record then the label appears for all listed records. When I click on a different record the is disappears again. I guess it's due to the Form_Current event, but that was the only one that made sense to me... (I'm still new to this whole Access VBA thing)
If anybody could help me I'd be really grateful...
Thanx
Luke
I have a (master) form in Single Form view. In this form I have a subform, which displays a list of other record that have the same GroupID as the record viewed in the master form. Obviously the list will also display the record viewed in the master form, so next to it i want to place something like a label "Currently open".
In the subform I created this lable and made it invisible, then I have a VBA script to check if the listed record matches the master record (using RecordID) and eventually make the label visible. The master RecordID is fetched from a global variable using the FetchRecordID() function.
I get the feeling I've done this completely wrong.
I used the Form_Current event of the subform to run the script and this is what it looks like:
Code:
Private Sub Form_Current()
If Me.RecordID = FetchRecordID() Then
Me.CurrentLabel.Visible = True
End If
End Sub
If anybody could help me I'd be really grateful...
Thanx
Luke