Un-cramp me brain?

1. Member
Join Date
Dec 1969
Posts
52

## Un-cramp me brain?

I am having a brain cramp here, can someone refresh my memory?<BR><BR>I am displaying a list of transactions from a database based on a query, and into a form. After each row of data, I am adding a checkbox with a dynamic name based on the Record Number (ie. "&#060;input type=check box name=DeleteRec" & rsTransaction("recno") & "&#062;")<BR><BR>When the form is updated, if the check box is checked I want to delete the record. To do so, I can strip off the RecNo from the name of the checkbox. In other words, DeleteRec19 means delete the record with a RecNo of 19.<BR><BR>So, I need to find a way to get the number. I thought about using the Right function, but that won&#039t work since the number after DeleteRec could be 1 or 3141 or 12512.<BR><BR>I know I should be able to figure this out, and I would love to blame in on not feeling well. But I am just actually having a total collapse.<BR><BR>Help?<BR><BR>Erika

2. Senior Member
Join Date
Dec 1969
Posts
226

## RE: Un-cramp me brain?

num = Mid(your_chkbox_name, Len(DeleteRec) + 1)

3. SPG Guest

Look into the "Mid" function -- it allows you to take part of a string (or the rest of the string) starting a at a position from the left. You would want something like<BR><BR>foo = cInt(mid(checkBoxName, 9))<BR><BR>The 9 is probably +/- 1 -- I&#039m terrible at string counting without a script to test.<BR><BR>Cheers!

4. Chrace Guest

## RE: Un-cramp me brain?

Idea is close, try with Len as well :)<BR><BR>sDel = Request("DeleteRec" & i)<BR>Number = Cint( Right( sDel, Len( sDel ) - 9 ) ) &#039 9 for "DeleteRec"

5. E! Guest

## RE: Un-cramp me brain?

&nbsp;<BR>What if you checked the length first to see how many characters to use with the RIGHT funtion? DeleteRec would never change... That way you could subtract 9 from the len value...<BR><BR>Just an idea? I feel my brain leaking from my ear!

6. Senior Member
Join Date
Dec 1969
Posts
154

## RE: Un-cramp me brain?

Recno = trim(right(Checkbox_Name,len(Checkbox_Name)-(Instr(Checkbox_Name," "))))<BR><BR>Hope This helps.

7. Member
Join Date
Dec 1969
Posts
52

## THANX! Used Right(Box, Len-9) (n/t)

NT

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•