Toggle Button

P

Peter

Hi all

...in a form..i have a unbounded text field and a unbounded toggle button..on
clicking the toggle button I want to change the value in the unbounded text
field to Yes or No...how do I do this?

Thanks!
 
R

RonaldoOneNil

In the click event of your toggle button put this code

If YourTextBoxName = "Yes" Then
YourTextBoxName = "No"
Else
YourTextBoxName = "Yes"
End If
 
P

Peter

Thanks You Ronaldo..but it does not work..should i assign a default value to
the textbox?
 
P

Peter

Nope..i put the Data Source of the Textbox =IIf([Toggle31],"Yes","No")..and i
click on the toggle button..but nothing..starnge indeed
 
P

Peter

The toggle button does not "toggle"..and no defualt values besides format
Yes/No of the textbox

Peter said:
Nope..i put the Data Source of the Textbox =IIf([Toggle31],"Yes","No")..and i
click on the toggle button..but nothing..starnge indeed

Marshall Barton said:
Maybe all you need is to set the text box's expression to
something like:

=IIf(togglebutton, "Yes", "No")
 
P

Peter

Got it...it does not work with a toggle button..but with a command
button..the code ..Thanks both Ronaldo and Marshall!

Peter said:
The toggle button does not "toggle"..and no defualt values besides format
Yes/No of the textbox

Peter said:
Nope..i put the Data Source of the Textbox =IIf([Toggle31],"Yes","No")..and i
click on the toggle button..but nothing..starnge indeed

Marshall Barton said:
Peter wrote:
..in a form..i have a unbounded text field and a unbounded toggle button..on
clicking the toggle button I want to change the value in the unbounded text
field to Yes or No...how do I do this?


Maybe all you need is to set the text box's expression to
something like:

=IIf(togglebutton, "Yes", "No")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top