If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Error "2115"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-12, 07:58
oMADMANo oMADMANo is offline
Registered User
 
Join Date: Jan 2012
Posts: 16
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 08:02. Reason: added more detail
Reply With Quote
  #2 (permalink)  
Old 02-05-12, 08:11
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
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!
Reply With Quote
  #3 (permalink)  
Old 02-05-12, 10:19
oMADMANo oMADMANo is offline
Registered User
 
Join Date: Jan 2012
Posts: 16
Wow thanks I have tried everything, never thought of that though.
SOLVED !
Reply With Quote
  #4 (permalink)  
Old 02-05-12, 11:49
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
You're welcome!
__________________
Have a nice day!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On