Click label to populate text

  • Thread starter fapa via AccessMonster.com
  • Start date
F

fapa via AccessMonster.com

Hi

Would anyone know if this is possible?

I have form made up on lots of unbound labels - when i Click one for the
labels, i want the data from the label to populate a text box (in another
form) and turn the label outline to another colour.

I have No idea if this is possible -am i being too ambititous?
 
P

Paul D

fapa via AccessMonster.com said:
Hi

Would anyone know if this is possible?

I have form made up on lots of unbound labels - when i Click one for the
labels, i want the data from the label to populate a text box (in another
form) and turn the label outline to another colour.

I have No idea if this is possible -am i being too ambititous?

I have not done any access programming for many years now (VFP user) so I
can't give you the correct synyax but a rough layout of prog would be
something like

in the OnClick event
Forms!Formname!Controlname.value = me.caption
Me border colour = New colour


no doubt you know a little more about Access syntax than I remember and
hopefully you should be able to translate injto 'real' access code.
 
D

Duane Hookom

You can reference Captions of labels or Values of text boxes. Either of
these is a string that can be placed into an unbound text box on another
form. The On Click event would be something like:

Private Sub lblOne_Click()
Dim strText As String
strText = Me.lblOne.Caption
Forms!frmBinClick!txtYourText = strText
Me.lblOne.BorderColor = vbRed
End Sub

Make sure the label border is not set to transparent.
 

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