Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2011
    Posts
    33

    Unanswered: Data validation - multiple controls

    Hello,

    I'm trying to set up some data validation for four controls on my form that I want to run when I click a 'submit email' button. I'm using the following code:


    Code:
    If Not Len(Nz(Me.Program)) > 0 Then
       MsgBox = "Please select a program"
       Me.Program.BackColor = vbRed
       Me.Program.SetFocus
    Else
       Me.Program.BackColor = vbWhite
    End If
    It works fine for the first control, but for controls I enter after I can't select '.BackColor' or '.SetFocus' my only option is .Value

    What am I doing wrong?

    Thanks for reading.

    Jeremy

  2. #2
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    Are you just saying then when writing the code and you get to the dot it doesn't offer you many options?

    If so - though disconcerting - I wouldn't worry too much so just write what you need and see if it works.
    Regards
    JD

    Software-Matters

  3. #3
    Join Date
    Sep 2011
    Posts
    33
    Yes, only '.Value' is available. I tried just typing manually by receive the following:

    Compile error:
    Method or data member not found

  4. #4
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    119
    What is the name of the control you are trying to use?
    And though obvious check that the control is definitely on your form named like this?
    Regards
    JD

    Software-Matters

  5. #5
    Join Date
    Sep 2011
    Posts
    33
    Oh wow, you are spot on. I was putting in the control source name not the combo box name.

    Thanks heaps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •