Changing the mouse pointer over a textbox

B

Bob Hairgrove

I have a textbox which is meant to be clicked on, not edited. It is an
unbound control in a subform in continuous view. There is code in the
OnClick event procedure which calls Application.FollowHyperlink. I
need to have a different URL for each record, which is why I can't use
an ordinary label for this (clicking on a label doesn't make the
record current, if you've never tried this yourself ... ).

Everything works fine, except that the mouse pointer changes to the
insertion caret when hovering over the text box. Is there any way to
keep the arrow mouse pointer?

Thanks for any tips!
 
M

Mark A. Sam

I'm not sure what you mean when you say that clicking on a label doens't
make a record current. I'm not sure of the purpose of the unbound textbox,
or really what you are doing in general, but from what I can glean, you can
possible use a label's caption property to display your text, and place a
button over it and place the code in the Button OnClick event. Set the
Transparent property of the button to yes to make it invisible but still
effective.

God Bless,

Mark A. Sam




I have a textbox which is meant to be clicked on, not edited. It is an
unbound control in a subform in continuous view. There is code in the
OnClick event procedure which calls Application.FollowHyperlink. I
need to have a different URL for each record, which is why I can't use
an ordinary label for this (clicking on a label doesn't make the
record current, if you've never tried this yourself ... ).

Everything works fine, except that the mouse pointer changes to the
insertion caret when hovering over the text box. Is there any way to
keep the arrow mouse pointer?

Thanks for any tips!
 
B

Bob Hairgrove

I'm not sure what you mean when you say that clicking on a label doens't
make a record current.

I have a subform which displays its records in continuous form view.
Let's assume that the first record has the focus. If I click on a
label located in the second record's detail section, the label's
OnClick event will fire. However, the first record is still the
current record, not the second.

I need to have a different URL as hyperlink address for each record.
That is something that works with a text box, but doesn't work with a
label because the value of the label's HyperlinkAddress property is
always the same for all records. I can change it in the subform's
OnCurrent event, but that won't fire unless I change the focus to the
other record, and a label can't receive the focus.

Maybe a command button would do the trick. I'll try this out. Thanks
for making me think some more and in a different direction about the
problem!
 
M

Mark A. Sam

Bob,

I am thinking that the best thing is to make a table for your purpose using
a hypelink field. That way, the mouse pointer will stay as an arrow and you
can add a different hyperlink to each record.

God Bless,

Mark


I'm not sure what you mean when you say that clicking on a label doens't
make a record current.

I have a subform which displays its records in continuous form view.
Let's assume that the first record has the focus. If I click on a
label located in the second record's detail section, the label's
OnClick event will fire. However, the first record is still the
current record, not the second.

I need to have a different URL as hyperlink address for each record.
That is something that works with a text box, but doesn't work with a
label because the value of the label's HyperlinkAddress property is
always the same for all records. I can change it in the subform's
OnCurrent event, but that won't fire unless I change the focus to the
other record, and a label can't receive the focus.

Maybe a command button would do the trick. I'll try this out. Thanks
for making me think some more and in a different direction about the
problem!
 
B

Bob Hairgrove

I am thinking that the best thing is to make a table for your purpose using
a hypelink field. That way, the mouse pointer will stay as an arrow andyou
can add a different hyperlink to each record.

Thanks, Mark. This is getting closer to what I want to do, but I'm not
there yet. First of all, I am using Access 97, so there might be more
hyperlink functionality in later versions that I don't know about.

My trouble now is that the hyperlink is put together from different
elements depending on the values in two other columns which together
comprise the primary key of the table. IOW, the hyperlink address
shouldn't be stored in the table, but calculated in a query. Storing
it in the table, of course, duplicates information and would cause
maintenance headaches.

How do I get the calculated field to format itself as a hyperlink and
not as plain text? I have built a string in the query calculation
similar to this:
"Go to website...#http://abc.com/cgi?id=" & [other values] & "#"
Unfortunately, Access displays the entire string as ordinary text.
 
B

Bob Hairgrove

I've now solved the problem by putting a command button on the subform
which calls Application.FollowHyperlink in its OnClick event
procedure. Since buttons, unlike labels, can receive focus, the
subform's focus changes as well. That way I can use the calculated
field as the hyperlink address.

Thanks, Mark, for your input. Have a nice day! :)
 

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