Brian
|
Posted: 02/04/2002, 7:39 AM |
|
I am using ASP + Templates with an Access 2000 DB.
Using a grid form displaying the filtered contents of one table, each record has an icon displayed beside it. I need to click on the graphic and move the record to a second table. Both tables are virtualy identical with autonumber ID's.
Can anybody suggest how I would go about this? Thanks.
|
|
|
Tomasz
|
Posted: 02/04/2002, 9:55 AM |
|
use checkbox instead of icon, then custom sql in 'before update' event.
Code have to check if checkbox is checked, then execute 2 sql actions:
- insert selected record in 2nd table,
- then delete it from 1st table
If you still want to use icon, you must use javascript and onclick to execute sql action, but I have no idea how asign unique names to icon images.
|
|
|
Brian
|
Posted: 02/05/2002, 12:56 AM |
|
I have had no problem with the Icon, I used the following in the 'Before Show' event of the grid form.
fldField2 = "<img id=tx border=0 src=images/up.gif alt='transfer to delegates' ondblclick=test('" & fldCourse_ID & "') style=cursor:hand>"
This sends the fldCourseID to a sub 'test' in the page header, at the moment this just produces a msgbox with the contents of fldCourseID. But I don't seem to be able to run the sql form there. Where should the sql be as the grid form does not have a 'Before Update' event?
|
|
|
Tomasz
|
Posted: 02/05/2002, 4:21 AM |
|
'open' or 'before show' event of target page/form?
|
|
|
Brian
|
Posted: 02/05/2002, 4:31 AM |
|
Thanks for the suggestion Tomasz.
I decided to do things in a different way, instead of trying to move a record from one table to another, I now have one table with a check box field.
So now I only need to have 2 grids forms filtered on the check box field and I can effectively move the record from one to the other by checking the check box.
There is allways a more efficiant way of doing things, it just takes me a while to find it.
Thanks
|
|
|
Tomasz
|
Posted: 02/05/2002, 4:59 AM |
|
yes, that's right..
in my project I use both solutions: moving between tables for authentication of new users (with password encryption during move), and checkbox for temporary blocking user. first is for security, second for flexibility..
|
|
|
|