...

View Full Version : MS Access - if yes/no field is checked, then display x, else display n



mattboy_slim
06-16-2005, 09:31 PM
How, using ASP, can I say:

If field is checked, then response.write("Checked") Else response.write("Not Checked")

I've searched the forums here, and tried using Google, but to no avail, so now I'm asking for help.

Thanks in advance,
Matt

nikkiH
06-16-2005, 10:07 PM
When do you want it to occur?
On the server-side, after form submit, just check for the value of your checkbox like any other form field. If you want to know on the client side, before form submit, you have to use javascript.
See here (http://www.htmlgoodies.com/primers/asp/article.php/11884_3478001_2) for a little forms tutorial.

mattboy_slim
06-16-2005, 10:16 PM
I have a recordset that is retrieving information for me that I am displaying on a page. The information is already sitting in a database.

Specifically, what I am doing, is I have a Yes/No field in Access, that notes whether or not registration is available for an event. In my recordset, where I am showing the different events, I want to show a register button if the field 'f_register' is checked, otherwise I want to hide it. I could do this with a text type field, using "Yes" and "No", but I'd rather use a checkbox type field in Access.

nikkiH
06-16-2005, 10:37 PM
[edited]
Okay, see if this link helps you.
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=141

Freon22
06-16-2005, 10:49 PM
I want to show a register button if the field 'f_register' is checked, otherwise I want to hide it. I could do this with a text type field, using "Yes" and "No", but I'd rather use a checkbox type field in Access.

It would be easer if you would show your code. But I think I would do something like.

If objRS(“f_register”) = True Then
Response.Write(“Checked”)
Else
Response.Write(“Not Checked”)
End If

If you are using some type of button, that you only want to show if f_register is checked. You could

If objRS(“f_register”) = True Then
‘Show Button
End If

So as you can see there are a lot of way to do this.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum