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. Advertisements

  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. Advertisements

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. Paul Hale
    Replies:
    2
    Views:
    598
    Kevin Spencer
    Oct 28, 2003
  2. Li Zhang
    Replies:
    4
    Views:
    6,367
    softip
    Feb 27, 2009
  3. AGSHAR
    Replies:
    1
    Views:
    717
    AGSHAR
    May 31, 2008
  4. ErwinP
    Replies:
    1
    Views:
    1,102
    ErwinP
    Aug 19, 2005
  5. Felix Wafytech

    Read value from a Textbox in a grid view.

    Felix Wafytech, May 23, 2007, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    350
    vMike
    May 24, 2007
  6. Guest
    Replies:
    2
    Views:
    298
    Bob Barrows [MVP]
    Feb 20, 2006
  7. Steve
    Replies:
    4
    Views:
    411
    Steve
    Feb 7, 2006
  8. Replies:
    2
    Views:
    767
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...