Results 1 to 4 of 4

Thread: Error "2115"

  1. #1
    Join Date
    Jan 2012
    Posts
    16

    Unanswered: Error "2115"

    Im getting the error on trying to edit my text box with code. There is no before update event so I am guessing its a validation rule error.
    Here is my code:

    Code:
    If IsNull(Doctorcombo) Then
    Doctorcombo2.Visible = False
    
     DoctorAddress.Visible = False
     
    ElseIf Doctorcombo = "Bankhouse Surgery" Then
    Doctorcombo2.Visible = True
    
    Me.Doctorcombo2.RowSource = ""
    Doctorcombo2.AddItem "DrOne"
    Doctorcombo2.AddItem "DrTwo"
    
    DoctorAddress.Visible = True
    
    [DoctorAddress].SetFocus
                                       'error on this section
    DoctorAddress.Text = "hello" & vbCrLf & _
                        "world" & vbCrLf & _
                        "world" & vbCrLf & _
                        "world"
    All I am trying to do is enter an address in the text box when a certain combo box option is selected , hello world is just an example to try get it to work.

    Please help.
    Last edited by oMADMANo; 02-05-12 at 09:02. Reason: added more detail

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try to use the Value property of the textbox, not the Text property. Except in very special circumstances and for very special purposes, the Text property should never be used.
    Have a nice day!

  3. #3
    Join Date
    Jan 2012
    Posts
    16
    Wow thanks I have tried everything, never thought of that though.
    SOLVED !

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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