View Single Post
  #2  
Old May 28th, 2010, 03:20 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Toggle button vs Command button

On Fri, 28 May 2010 07:14:01 -0700, Steve Stad
wrote:

This may be related to trying to set the focus at an inopportune time.
Fortunately it is not necessary, if you replace your two lines with:
HelpWindow.Value = "Hello World"
(.Text requires the control to have focus; .Value does not)

-Tom.
Microsoft Access MVP


I was using command buttons to write text in a text box. The command buttons
work fine. I was thinking of using toggle buttons because toggle buttons
change color/shading when pressed. The toggle button writes the text in the
box but I get a 'Run-time error '2115' - The macro or function set to the
BeforeUpdate or ValidationRule property for this field is preventing dbname
from saving data in the field. END/DEBUG. I am using the 'OnClick' Event
to write the text. Do I need code in another event?

Private Sub Toggle21_Click()
HelpWindow.SetFocus
HelpWindow.Text = "Writes this text"
End Sub