lorsungcu
asked on
Post data from form fields to URL as variables within MS Access
I have a need to create a form within Access, with a button that will send the current values of the form as values within an xml request to a URL. The remote server will return something, and I will need to have the ability to log or display that information.
Ive never done anything like this within Access; is it possible? Ive got all the forms/tables made, I can provide them if needed.
Ive never done anything like this within Access; is it possible? Ive got all the forms/tables made, I can provide them if needed.
Yes it is possible to do with Access. What version of Access are you using?
ASKER
2010
I'm not quite sure what you're trying to do, but you can perform HTTP POST requests from code in an Access form by adding a reference to the Microsoft WinHTTP Services library (via the WinHttpRequest object).
ASKER
Thanks, I got it working using objSvrHTTP, and POSTing XML as a string. What I need now is to pull information from fields within a form, so when a user clicks a button, the values currently displayed are sent as values within the XML.
Do you mean that you just want help with the string manipulation, to build the XML?
ASKER
Essentially, yeah. Am I able to define a variable as the result of a query? I must, I'm just not clear on how. I have a form where a user chooses their username, enters a password, and submits; it just checks that that all matches and send them to a second screen. I need to use that username/password to query for two other values that I then need to insert into the XML.
My thought was to make a table that stores what user is currently logged in, as well as the values I need, and pull from there? So when they click log in, create a new unique record of the login in this table, and use a look up to get the values I need? Or is there a better way?
Thanks for the help!
My thought was to make a table that stores what user is currently logged in, as well as the values I need, and pull from there? So when they click log in, create a new unique record of the login in this table, and use a look up to get the values I need? Or is there a better way?
Thanks for the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I need, but I am going about it a bit differently...I will give this a shot and see if I can apply it.
Thanks!
Thanks!
How were you "going about it a bit differently"?
You could use DLookup() instead, but you'd need 2 calls in order to obtain the 2 values to insert into your XML - which is why the record set approach is better! :-)
You could use DLookup() instead, but you'd need 2 calls in order to obtain the 2 values to insert into your XML - which is why the record set approach is better! :-)
How are you getting on with this question? Do you need any more help or advice?
ASKER
Thanks, works great.
Glad I could help! :-)