Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP - Access - & Checkboxes?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP - Access - & Checkboxes?

 Post Reply Post Reply
Author
Garrett1226 View Drop Down
Newbie
Newbie
Avatar

Joined: 09 January 2004
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Garrett1226 Quote  Post ReplyReply Direct Link To This Post Topic: ASP - Access - & Checkboxes?
    Posted: 16 January 2004 at 4:32pm

I have an HTML form that posts to an ASP engine updating an Access database.

How do I script for posting the choice made between multiple checkboxed fields to one column in my table?  To be more specific:

This is how I have been updating a text field named contact to a Table column named ContactTime: My recordset is rsCropLeads:

rsCropLeads.Fields("ContactTime") = Request.Form("contact")

On my form I have 4 checkbox fields for different insurance types.  I want the field/fields checked to be entered into my column named "Type" in my access DB.  I tried the following, but, the field in the column remained empty when ran:

rsCropLeads.Fields("Type") = Request.Form("CropHail" + "MPCI" + "CRC" + "Unsure")

Any Ideas?

Thanks

Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2004 at 5:31pm
How is this related to the Forum Support?
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2004 at 5:54pm

this should be posted in the asp forum..

but, i didnt really understand your question

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2004 at 7:43pm

request.form brings back a single field and could not find one named "CropHail" + "MPCI" + "CRC" + "Unsure"

Try...

rsCropLeads.Fields("Type") = request.form("CropHail") + request.form("MPCI") + request.form("CRC") + request.form("Unsure")

If none are checked, you'll get a 0.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2004 at 7:50pm
Originally posted by MadDog MadDog wrote:

How is this related to the Forum Support?

How is that helpful at all? Just more noise.

Back to the question ....
The best solution to you multiple checkbox would be a multiple choice select. This way you are checking one posted field rather than attempting to append multiple fields together.
Back to Top
alachig82 View Drop Down
Newbie
Newbie
Avatar

Joined: 17 January 2004
Location: Iran
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote alachig82 Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2004 at 5:15pm

yes, you must used

request(checkbox1 name) & request(checkbox2 name) &...

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2004 at 2:42am
Yea, the way you're doing it it's looking for a field called CropHailMPCICRCUnsure so that's why it returns null,

I think the best solution is to name all the checkbox fields the same like:

<input type="checkbox" name="checkboxes" value="1">Checkbox1<br>
<input type="checkbox" name="checkboxes" value="2">Checkbox2<br>
<input type="checkbox" name="checkboxes"  value="3">Checkbox3<br>
<input type="checkbox" name="checkboxes" value="4">Checkbox4<br>

Then use Request.Form("checkboxes"), it will return the values of all the checked fields separated by commas, if you don't want the separated by commas then use:

Replace(Request.form("checkboxes"), ",", "")


Edited by fernan82
FeRnAN
Back to Top
Garrett1226 View Drop Down
Newbie
Newbie
Avatar

Joined: 09 January 2004
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Garrett1226 Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2004 at 8:28am

Thanks for everyone's help on this issue.  I apologize for posting this question in the wrong section of the forum.

I appreciate how open and helpful members of this forum are.  Makes it easier to learn, understand and develop the skills I use in may day-to-day activities.

Thanks to everyone again.

Garrett

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.