G
Guest
Thanks for taking the time to read my question.
I have a form on which I have labels. In the On Open event I want to be able
to save a number in the tag of each label.
rst.MoveFirst
Do Until rst.EOF
Me.Controls(rst!BookingRoomDaySlot).Top = rst!Position * 0.3937
* 1440 '0.3937 converts cm to in.
Me.Controls(rst!BookingRoomDaySlot).Height = rst!HeightOfSlot *
2 * 0.5 * 0.3937 * 1440 '0.3937 converts cm to in.
Me.Controls(rst!BookingRoomDaySlot).Tag = rst!tblBookingID
Me.Controls(rst!BookingRoomDaySlot).Visible = True
Debug.Print Me.Controls(rst!BookingRoomDaySlot).Tag
'This prints the correct value, but for some reason, it is not
saved to the Tag property
rst.MoveNext
Loop
This code works, and you can see the debug.print value in the Immediate
window.
However, when I mouse over the lable, the tag is "". Am I not using the Tag
property correctly?
Private Sub R2We1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
MsgBox Me.Tag
'I get a message box with nothing in it.
End Sub
Not sure what I am doing wrong. What I want to accomplish in the end is,
store the recordID number in the tag, so that when I double click on the
label, a form will open and filter based on the OpenArgs (in which I'll put
the Tag value). Then I will be able to edit the record associated to the
recordID (Like in Outlook when you double click on a calendar item and then
can edit the info)
Thanks for the help.
Brad
I have a form on which I have labels. In the On Open event I want to be able
to save a number in the tag of each label.
rst.MoveFirst
Do Until rst.EOF
Me.Controls(rst!BookingRoomDaySlot).Top = rst!Position * 0.3937
* 1440 '0.3937 converts cm to in.
Me.Controls(rst!BookingRoomDaySlot).Height = rst!HeightOfSlot *
2 * 0.5 * 0.3937 * 1440 '0.3937 converts cm to in.
Me.Controls(rst!BookingRoomDaySlot).Tag = rst!tblBookingID
Me.Controls(rst!BookingRoomDaySlot).Visible = True
Debug.Print Me.Controls(rst!BookingRoomDaySlot).Tag
'This prints the correct value, but for some reason, it is not
saved to the Tag property
rst.MoveNext
Loop
This code works, and you can see the debug.print value in the Immediate
window.
However, when I mouse over the lable, the tag is "". Am I not using the Tag
property correctly?
Private Sub R2We1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
MsgBox Me.Tag
'I get a message box with nothing in it.
End Sub
Not sure what I am doing wrong. What I want to accomplish in the end is,
store the recordID number in the tag, so that when I double click on the
label, a form will open and filter based on the OpenArgs (in which I'll put
the Tag value). Then I will be able to edit the record associated to the
recordID (Like in Outlook when you double click on a calendar item and then
can edit the info)
Thanks for the help.
Brad