Which Field is Selected ?

  • Thread starter Thread starter Alan Plaid
  • Start date Start date
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
 
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.
 
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.
 
Back
Top