Using a Lookup Function in a Text Box's Control Tip Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table called "tbl_Locations" that has a LocCode and Location.
Sample Record in the table would be-
LocCode: 123 Location: Podunk
I have a form with LocCode in it. When the mouse hovers over the LocCode we
want to have the Control Tip Property of the textbox display the actual
Location by using the tbl_Locations table to look up the Location from the
LocCode.
Any suggestions.
 
If you are using a single form view, you can write code on the form's
OnCurrent event to reset the ControlTipText property of that textbox.
However, this won't work well if you have a continuous view form; hovering
over a textbox doesn't cause any events to fire which could be trapped to
make the change, so Access has no way of knowing what record you are
hovering on.

HTH
 
You could use the Form's OnCurrent event procedure to set the Control's
ControlTipText property:

Me!FieldName.ControlTipText = DLookup("Loaction","tbl_Locations","LocCode =
" & Me!FieldName)

Change 'FieldName' to the name of your field containing LocCode.

Steve
 
Oh I like that one! Thank you!!
You could use the Form's OnCurrent event procedure to set the Control's
ControlTipText property:

Me!FieldName.ControlTipText = DLookup("Loaction","tbl_Locations","LocCode =
" & Me!FieldName)

Change 'FieldName' to the name of your field containing LocCode.

Steve
I have a table called "tbl_Locations" that has a LocCode and Location.
Sample Record in the table would be-
[quoted text clipped - 4 lines]
LocCode.
Any suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top