Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HitTest in Detailssection of a form

Status
Not open for further replies.

checkOut

Technical User
Joined
Oct 17, 2002
Messages
153
Location
NL
Using Access2000:
Question:
frm with 52 weeklabels, I have to run a function based on the weeklabel which is hit. But I don't like to have 52 clickEvents, so I'm searching for a better way.
In a treeview I used the way like this:
Set Treeview1.SelectedItem = Treeview1.HitTest(X, Y)
Now I thougt to use the same principe in the details as follows:
Private Sub Details_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox Details.HitTest(X, Y)
End Sub

But this gives an error by compiling: can't find method or...
 
Can you use a Combobox with values 1 thu 52 instead? (You can check its AfterUpdate() event and react accordingly.) Jim Kraxberger
Developing Access solutions since 1995
 
Hi,

If you absolutely have to use the 52 labels then
you should build a function in a Module
and link the OnClick event of each label to the function

ex: WeekClicked(sLabelName)

that way you would only have one function able to react with all 52 OnClick events

Hope it helps SG
 
Jim and Rick,
Thanx for both of ur reactions
Jim: No, its vertical outlined in a bar, so labels (or textboxes) are the only possibility
Rick: I understand what u mean and just thought about it, it's my last way out.. but I like a simple way. Why doesn't the HitTest working for details.

Thnx in advance,

Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top