Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop variable into Request.Form statement

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
0
0
GB
Hi - I'm trying to drop a variable in a Request.Form query like so:

If Request.Form("item" & myVar) Then..

Obviously the above doesn't work. I've tried about ten different configurations of the above, like Request.Form(myVar) etc, and each time I get this error :- Type mismatch: '[string: ""]'

Surely there is a way to drop a variable into a Request.Form procedure?

Thanks,

Matt
 
Don't know if this is what you are trying to do or not but I think what you are trying to do is this: request a piece of data from a form, then use that data in conjunction with something else to test a condition. If this is the case, you should assign the form field to a var then add the data to that var. You can then use this to test your conditional (If..Then) in this case.

Something like this should work (using your myVar example).

Dim myVar
Dim myVar2


'set myVar = to whatever
myVar2 = Request.Form("item")
myVar2 = myVar2 & myVar
If myVar2 = whatever then....


Hope this helps,
Matt H.

 
Thanks Matt. Got it sorted now - cheers.
Matt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top