how to read value from a textbox in a new form

K

Krechting

Hi All,

I tried to read the value of a textbox in another form.
I have a page which contains one record. The textbox "txtWID" contains
the autonumber of the record. I want to read this value in a new page
so
I can set a WHERE for my query:

Dim eben
session("txtWID")=request("txtWID")
eben = request("txtWID")
SQL = "SELECT Weapon.WID AS Weapon_WID, Weapon1.name AS Weapon1_name
" & _
"FROM (WeaponsPerWeapons INNER JOIN Weapon ON
WeaponsPerWeapons.WID = Weapon.WID) INNER JOIN Weapon Weapon1 ON
WeaponsPerWeapons.Weapon = Weapon1.WID"
CountSQL = "SELECT COUNT(*) " & _
"FROM (WeaponsPerWeapons INNER JOIN Weapon ON
WeaponsPerWeapons.WID = Weapon.WID) INNER JOIN Weapon Weapon1 ON
WeaponsPerWeapons.Weapon = Weapon1.WID"
Where = "Weapon.WID = " & eben
Order = "Weapon1.name"
session("txtWID") = ""

This is however not working because I use an imagelink to go to the
new page.
There is no way to put the value of the txtWID into the URL of the
link image.
I tried something like href="weapon_related.asp?<%=.....%>" but that
doesn't work. If I write "href=weapon_related.asp?26" then I can
translate this for the
WHERE clausule but I want to get the value of the autonumber field
since it's
never the same.
This would then work eben = Replace(Request.QueryString,"%20"," ")
Where = "Weapon1.WID = " & eben

What is my mistake

Regards
MArco
 
O

only_me

Probaly the 1st thing to do is put a "submit" button on the form to confirm
that your are posting and receiving the information you expect.
Then add some javascript to the image to be used as the link to force a
SUBMIT via an onClick within the image link code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top