We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Checkbox update record

vonfranzken
vonfranzken asked
on
Medium Priority
2,433 Views
Last Modified: 2012-08-14
Is it possible to have a master page with a checkbox, that can update a record if selected?
Comment
Watch Question

Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

Commented:
Hi vonfranzken,

Yes, it is possible.

Could you post a little more detail about what you are trying to do and which server model you're doing it with?

Author

Commented:
Sure in fact here is a copy of the error I get when I try to it says.

Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/musicforall/newsroom/news_master.asp, line 267


Line 267 is this:
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">

This is put in when I apply the update record to the checkbox via the master list.

Author

Commented:
Im sorry asp
Jason C. LevineDon't talk to me.
CERTIFIED EXPERT

Commented:
It sounds like the Primary key value is not set in the form.  DW's update behavior requires the unique ID number of the record to be updated to be present in the form.  How are you setting that?

Author

Commented:
Well Im not Im just listing from lets say recordset1 a master list of records which resides in form1 with an added checkbox
I then applied an update behavior to the checkbox, and used the same recordset which lists them.
I then have a javascript submit form behavior applied to the checbox to submit the update in the event it is checked or un-checked.

I think its having a hard time distinguishing which record to update via the master list.

Steve
Don't talk to me.
CERTIFIED EXPERT
Commented:
Steve,

Right.  You are misusing the update record behavior.  The built-in behavior requires one primary key per form in order to work correctly.

If you output a bunch of records in a repeat region and stick that region inside of a form, you can't use the update record behavior.

What you can do is put the form tags INSIDE the repeat region (in a table cell, say) and your method should work.  It may require you to do a little hand coding, though.

The other way to do this with only one form is to have all values submit as an array and then hand code the update behavior so that it steps through the array and runs the sql update for each record in the array.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.