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

J

John Bigness

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.
 
M

MacDermott

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
 
S

SteveM

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
 

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

Top