Output form from msg box to store or print

J

JHB

Hi:

I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.

Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?


LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")


Thanks

John Baker
 
D

Douglas J Steele

Rather than using a message box, create a form that you display the values
on.

"JHB" wrote in message

Hi:

I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.

Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?


LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")


Thanks

John Baker
 
J

JHB

Rather than using a message box, create a form that you display the values
on.

"JHB"  wrote in message


Hi:

I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX  does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.

Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?

LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")

Thanks

John Baker

Thanks..
I know how to create a form of course, but not what should command I
need to put the data into the form or exactly how to set the form and
table up to accept the data..

The fields are


"Destination address" followed by a field with [" ...."]
"Origin Address"followed by a field with [" ...."]
"rows"
"Elements"
"Distance"
"Text"= 1178 km
"Value"= 1177940
"Time"
"Text"="13 hr 3 min"
"Value"=46964


"Status"
"OK"

If you could tell me how to set up the form (and underlying table) AND
what setup to use to put the data into the form I would appreciate it.

Thanks
 
D

Douglas J Steele

When you use DoCmd.OpenForm to open a form, there's a free-form parameter,
OpenArgs, that can be used to pass anything you want.

In its simplest form, you could have a single text box on the form (let's
assume it's Forms1, with textbox Text1).

When opening the form, you could build up the entire message in a single
variable:

strOutput = "Destination Address = " & txtDestAddress & vbCrLf & _
"Origin Address = " & txtOriginAddress & vbCrLf & _

then pass that variable as the OpenArgs parameter:

DoCmd.OpenForm FormName:="Form1", View:=acNormal, _
WindowMode:=acDialog, OpenArgs:=strOutput

In the Load event of Form1, you'd read what was passed as the OpenArgs, and
assign it to the text box:

Private Sub Form_Load()

If IsNull(Me.OpenArgs) = False Then
Me!Text1 = Me.OpenArgs
End If

End Sub

If you wanted to get fancier, you could pass set strOutput to be a delimited
string, and then parse it the Load event, assigning different values to
different controls on the form.

"JHB" wrote in message

Rather than using a message box, create a form that you display the values
on.

"JHB" wrote in message


Hi:

I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.

Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?

LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")

Thanks

John Baker

Thanks..
I know how to create a form of course, but not what should command I
need to put the data into the form or exactly how to set the form and
table up to accept the data..

The fields are


"Destination address" followed by a field with [" ...."]
"Origin Address"followed by a field with [" ...."]
"rows"
"Elements"
"Distance"
"Text"= 1178 km
"Value"= 1177940
"Time"
"Text"="13 hr 3 min"
"Value"=46964


"Status"
"OK"

If you could tell me how to set up the form (and underlying table) AND
what setup to use to put the data into the form I would appreciate it.

Thanks
 
J

JHB

When you use DoCmd.OpenForm to open a form, there's a free-form parameter,
OpenArgs, that can be used to pass anything you want.

In its simplest form, you could have a single text box on the form (let's
assume it's Forms1, with textbox Text1).

When opening the form, you could build up the entire message in a single
variable:

strOutput = "Destination Address = " & txtDestAddress & vbCrLf & _
  "Origin Address = " & txtOriginAddress & vbCrLf & _

then pass that variable as the OpenArgs parameter:

DoCmd.OpenForm FormName:="Form1", View:=acNormal, _
  WindowMode:=acDialog, OpenArgs:=strOutput

In the Load event of Form1, you'd read what was passed as the OpenArgs, and
assign it to the text box:

Private Sub Form_Load()

  If IsNull(Me.OpenArgs) = False Then
    Me!Text1 = Me.OpenArgs
  End If

End Sub

If you wanted to get fancier, you could pass set strOutput to be a delimited
string, and then parse it the Load event, assigning different values to
different controls on the form.

"JHB"  wrote in message


Rather than using a message box, create a form that you display the values
on.
"JHB"  wrote in message


I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX  does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.
Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?
LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")

John Baker

Thanks..
I know how to create a form of course, but not what should command I
need  to put the data into the form or exactly how to set the form and
table up to accept the data..

The fields are

"Destination address" followed by a field with [" ...."]
"Origin Address"followed by a field with [" ...."]
"rows"
"Elements"
     "Distance"
              "Text"= 1178 km
                 "Value"= 1177940
"Time"
             "Text"="13 hr 3 min"
             "Value"=46964

"Status"
        "OK"

If you could tell me how to set up the form (and underlying table) AND
what setup to use to put the data into the form I would appreciate it.

Thanks

I am sorry to be so dense, but its just not working. Would the fact
that Xml was involved
(the original line was LResponse = MsgBox(objXML.responseText,
vbOKOnly, "Result")
have any effct on how the commands were configured, especially setting
up the variable in the first place?

John
 
D

Douglas J Steele

Let's see the code you're trying to use, and explain what "not working"
means. If you're getting an error message, what's the exact error message?

"JHB" wrote in message

When you use DoCmd.OpenForm to open a form, there's a free-form parameter,
OpenArgs, that can be used to pass anything you want.

In its simplest form, you could have a single text box on the form (let's
assume it's Forms1, with textbox Text1).

When opening the form, you could build up the entire message in a single
variable:

strOutput = "Destination Address = " & txtDestAddress & vbCrLf & _
"Origin Address = " & txtOriginAddress & vbCrLf & _

then pass that variable as the OpenArgs parameter:

DoCmd.OpenForm FormName:="Form1", View:=acNormal, _
WindowMode:=acDialog, OpenArgs:=strOutput

In the Load event of Form1, you'd read what was passed as the OpenArgs,
and
assign it to the text box:

Private Sub Form_Load()

If IsNull(Me.OpenArgs) = False Then
Me!Text1 = Me.OpenArgs
End If

End Sub

If you wanted to get fancier, you could pass set strOutput to be a
delimited
string, and then parse it the Load event, assigning different values to
different controls on the form.

"JHB" wrote in message


Rather than using a message box, create a form that you display the
values
on.
"JHB" wrote in message


I have a piece of code that interrogates Google Maps and right now
returns the results in a message box. I did not write the code and
have no real idea how it works, but would like to be able to tease out
of the results such information as miles and time, which are embedded
in it. To start I need to get the result in a form that can be stored
for further analysis. The MSGBOX does not allow storage, and doesnt
even allow it to be copied. At least I would like to be able to print
uit out so that I can share it with others to get advice.
Can someone tell me how to change the following line so that the items
in msgbox can be printerd and or stored?
LResponse = MsgBox(objXML.responseText, vbOKOnly, "Result")

John Baker

Thanks..
I know how to create a form of course, but not what should command I
need to put the data into the form or exactly how to set the form and
table up to accept the data..

The fields are

"Destination address" followed by a field with [" ...."]
"Origin Address"followed by a field with [" ...."]
"rows"
"Elements"
"Distance"
"Text"= 1178 km
"Value"= 1177940
"Time"
"Text"="13 hr 3 min"
"Value"=46964

"Status"
"OK"

If you could tell me how to set up the form (and underlying table) AND
what setup to use to put the data into the form I would appreciate it.

Thanks

I am sorry to be so dense, but its just not working. Would the fact
that Xml was involved
(the original line was LResponse = MsgBox(objXML.responseText,
vbOKOnly, "Result")
have any effct on how the commands were configured, especially setting
up the variable in the first place?

John
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top