how to read value from a textbox in a new form

Discussion in 'ASP General' started by Krechting, Jan 3, 2004.

  1. Krechting

    Krechting Guest

    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
     
    Krechting, Jan 3, 2004
    #1
    1. Advertising

  2. Krechting

    only_me Guest

    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


    "Krechting" <> wrote in message
    news:...
    > 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
     
    only_me, Jan 3, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Li Zhang
    Replies:
    4
    Views:
    6,141
    softip
    Feb 27, 2009
  2. AGSHAR
    Replies:
    1
    Views:
    610
    AGSHAR
    May 31, 2008
  3. ErwinP
    Replies:
    1
    Views:
    815
    ErwinP
    Aug 19, 2005
  4. Guest
    Replies:
    2
    Views:
    164
    Bob Barrows [MVP]
    Feb 20, 2006
  5. Steve
    Replies:
    4
    Views:
    238
    Steve
    Feb 7, 2006
Loading...

Share This Page