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
 
M

Marshall Barton

Peter said:
..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")
 
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")
 
M

Marshall Barton

That doesn't make sense. A Toggle button is just a
different looking check box.

The only way you would get that behavior is if you put the
toggle button in an option group. In that case the
containing option group is set to the toggle button's
OptionValue instead of the button being set to True or False
and it would only toggle when you click on another toggle
button in the option group.
--
Marsh
MVP [MS Access]

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")
 
T

tom_willpa

high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
 

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