Which Field is Selected ?

A

Alan Plaid

Using VB I am allowing the selection of a color from some
color picker code. I want to use a single button to allow
access to the color picker so I need to able to tell which
Field I need to assign the result to.

I presume I need to use the Me.? syntax, but dont know the
right syntax.

Also if I need to test whether or not the Field is suitable
for the color picker option do I have to have a long If Elsif
Elsif etc structure to test whether or not to allow the user
to use the button ?

My code is like this;
Dim tColor As Long
Dim tStringColor As String
tColor = tDialogColor()
If tColor <> -1 Then '-1 = No Color Chosen
tStringColor = ColorToHTML(tColor)
Me.HTMTAB1 = tStringColor ' This needs to be GENERIC
Me.Refresh
End If
MsgBox (tStringColor) ' For Testing



Thanks for any help
 
D

Douglas J. Steele

How are you wanting to do this?

If the user selects a control on the form, then clicks on the button to
launch the color picker code, you can refer to Screen.PreviousControl to
find out which control they clicked first.

Refer to the Screen.PreviousControl.ControlType to find out what type of
control it was.
 
A

Alan Plaid

How are you wanting to do this?

If the user selects a control on the form, then clicks on the button to
launch the color picker code, you can refer to Screen.PreviousControl to
find out which control they clicked first.

Refer to the Screen.PreviousControl.ControlType to find out what type of
control it was.
ta Doug, thats what I was looking for I think.
 

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