Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling in a Checkbox if I am editing a record 1

Status
Not open for further replies.

jazzz

Technical User
Feb 17, 2000
433
US
First, let me thank everyone in advance for your help it has always been great.

Here is what I am attempting to do. I have a form that I populate from an Access database when editing information. The code I use to populate my text fields is as follows:

<input name="txtLEUnits" type="text" id="txtLEUnits" value="<% If Not blnNew Then Response.Write rsItem("LEUnitsAvailable") End If%>" size="20" maxlength="5">

blnNew is a QueryString that I pass from another page when editing a record or adding a New record.

In my Access Database the only values stored for my check box are True or False. I have been attempting to get the checkbox on the form to show a check in it if the value from Access is True or -1 but I am having no luck. I can place a text box in lieu of the checkbox and fill it with Yes or No but I would rather use a checkbox if possible.

Anyone have any suggestions on how to accomplish this similar to the code above. This form will be used to edit an existing record or add a new one based on blnNew. Thanks Again.


Life's a journey enjoy the ride...

jazzz
 
Code:
<% if yourdbfield then %>
<input type="checkbox" name="whatever" value="whatever" checked>
<% else %>
<input type="checkbox" name="whatever" value="whatever">
<% endif %>

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy, it worked like a charm. Thank you!

Life's a journey enjoy the ride...

jazzz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top