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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing information from a url in Access 97 to fields on a .aspx page 1

Status
Not open for further replies.

RomeERome

Programmer
Nov 17, 2003
45
US
Hello All,

I have an Access 97 database that is passing values from a form via a url/hyperlink to two fields on a .aspx form. I can get one of the values to pass correctly, but not the second. I created a public constant, as you can see, so that all I have to do is type that variable name instead of the entire url/hyperlink whenever I needed it.

My url/hyperlink looks as follows:

Code:
Public Const CRWebRequest = "[URL unfurl="true"]http://webtest1/crportal/RequestReport.aspx?txtName="[/URL] & " txtTransID="

Passing one variable works great. See below:

Code:
Public Const CRWebRequest = "[URL unfurl="true"]http://webtest1/crportal/RequestReport.aspx?txtName="[/URL]

If anyone can guide me in the write direction, it would be greatly appreciated.
 
Querystring parameters are separated by an ampersand (&) so your constant would have to contain placeholders for each parameter which would be replaced as needed. I'd leave the base URL as the constant and tack on the parameters and values as needed.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Hey Mark,

The other piece of the code that I forget to add looks as follows:

Code:
FollowHyperlink (CRWebRequest & Me.Name & " " & Me.TransID

This is under a click subroutine. So when the user clicks to button, all of the necessary data is pre-populated into the web form so that the report can be pulled.

The syntax is what I'm having trouble with. As I stated earlier, I can pull the first piece of data, but it's the second piece that is not coming in properly.

Thanks
 

Need to specifiy the parameter name separated by the ampersand:

Code:
FollowHyperlink (CRWebRequest & Me.Name & [red]"&transId="[/red] & Me.TransID



Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Hey Mark,

Thanks for your assistance. I had to make a few modifications, but this is what my global constant and code looks like.

Code:
Public Const CRWebRequest = "[URL unfurl="true"]http://webtest1/crportal/RequestReport.aspx?"[/URL]

FollowHyperlink (CRWebRequest & "Name=" & Me.Name & " ?&txtTransID=" & Me.TransID)

When the url is presented in the address location on the web page it is displayed as follows:

Code:
[URL unfurl="true"]http://webtest1/creditreportingportal/RequestReport.aspx?Name=Joe[/URL] Blow ?&txtTransID=A20089Qthat's8239625

It works like a champ. Thanks for getting me on the right track. This may be a thread that should be posted to the FAQ just in case someone else is trying to do the same thing.

Thanks again Mark!!!
 
The question mark isn't needed for each parameter, it only starts the querystring.

Code:
FollowHyperlink (CRWebRequest & "Name=" & Me.Name & " [red][s]?[/s][/red]&txtTransID=" & Me.TransID)

Which will result in:

Code:
[URL unfurl="true"]http://webtest1/creditreportingportal/RequestReport.aspx?Name=Joe[/URL] Blow&txtTransID=A20089


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top