CAN I ACCESS A WEB SITE FROM WITHIN A MS ACCESS FORM?

R

Rod Johnson

I have a database that includes names and addresses, with separate fields for
street address, city, and postal code. Currently, if I want to find the
address on a map, I must open the mapping program (for example, Google maps)
and enter the address into it by hand. Is there any way to open a new
sub-form from the data entry form that I use that opens an internet browser ,
loads the web address for( for example) Google maps, then loads the address
for the record showing in the current form into Google Maps and then
displays the map within the new sub-form?
 
E

efandango

Hello Doug,

I want to do exactly the same thing that Rod wants; So far I have managed to
call up googlemaps in a form, but cannot get my head around how to pass the
data from a control on another form to the 'webbrowser' code:

I have setup the MS ActiveX Webrowser on a form, and want to be able to take
the data from a field control on a tabbed form. At the moment i have the
following code on a 'on click event' set for a button on the same tab page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem to
parse the data from the control on the subform tab page. It may be that this
cannot be done, but i have afeeling it is just my bad syntaxt. Di i also have
to specify the 'tab name'? Can you help and tell me where i am going wrong?


To summarise:
The subform is called: Run_Points subform
The data control is called: Run_point_Address_D
 
D

Douglas J. Steele

The reference to the control needs to be outside of the quotes. As well,
your reference does look to be incorrect. If Run_point_Address_D is on the
same form as WebBrowser, it shouldn't be necessary to worry about the fact
that the form is being used as a subform:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=&" &
Me.Run_point_Address_D

should be sufficient.

The tab control name never needs to be used when referring to controls on
the tab: the control names have to be unique, even though they may be
replicated on the various tab pages.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


efandango said:
Hello Doug,

I want to do exactly the same thing that Rod wants; So far I have managed
to
call up googlemaps in a form, but cannot get my head around how to pass
the
data from a control on another form to the 'webbrowser' code:

I have setup the MS ActiveX Webrowser on a form, and want to be able to
take
the data from a field control on a tabbed form. At the moment i have the
following code on a 'on click event' set for a button on the same tab page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem to
parse the data from the control on the subform tab page. It may be that
this
cannot be done, but i have afeeling it is just my bad syntaxt. Di i also
have
to specify the 'tab name'? Can you help and tell me where i am going
wrong?


To summarise:
The subform is called: Run_Points subform
The data control is called: Run_point_Address_D






Douglas J. Steele said:
See whether my April, 2006 "Access Answers" column in Pinnacle
Publication's
"Smart Access" is of any help.

You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html. While you're there,
you
might also want to check out the November, 2003 column.
 
E

efandango

Douglas, Thanks for replying.

Run_point_Address_D is indeed on a control on a different form to the
WebBrowser. Since I posted the questions, I have placed this line of code:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=" &
[Form_Run_Points subform].[Run_point_Address_D]

which works. I did this more through trial and error. It is usually my
syntax that lets me down; do you know of a good resource for Access Syntax
that i can read up on, the MS manuals are ok, but i find them a little too
contextual. What I had in mind was something that describes the rules in
simple terms, such as your comment "The reference to the control needs to be
outside of the quotes" which is plain english and perfectly understandable. I
is things like when to, and not to use the [ or a . that baffles me. I have
never really gone into code too much, preferring to use macros and the
expression builder wizard. But now i'm gaining in confidence and want to
learn more.

Once again, I really appreciated your help.

Thanks.

Douglas J. Steele said:
The reference to the control needs to be outside of the quotes. As well,
your reference does look to be incorrect. If Run_point_Address_D is on the
same form as WebBrowser, it shouldn't be necessary to worry about the fact
that the form is being used as a subform:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=&" &
Me.Run_point_Address_D

should be sufficient.

The tab control name never needs to be used when referring to controls on
the tab: the control names have to be unique, even though they may be
replicated on the various tab pages.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


efandango said:
Hello Doug,

I want to do exactly the same thing that Rod wants; So far I have managed
to
call up googlemaps in a form, but cannot get my head around how to pass
the
data from a control on another form to the 'webbrowser' code:

I have setup the MS ActiveX Webrowser on a form, and want to be able to
take
the data from a field control on a tabbed form. At the moment i have the
following code on a 'on click event' set for a button on the same tab page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem to
parse the data from the control on the subform tab page. It may be that
this
cannot be done, but i have afeeling it is just my bad syntaxt. Di i also
have
to specify the 'tab name'? Can you help and tell me where i am going
wrong?


To summarise:
The subform is called: Run_Points subform
The data control is called: Run_point_Address_D






Douglas J. Steele said:
See whether my April, 2006 "Access Answers" column in Pinnacle
Publication's
"Smart Access" is of any help.

You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html. While you're there,
you
might also want to check out the November, 2003 column.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have a database that includes names and addresses, with separate
fields
for
street address, city, and postal code. Currently, if I want to find the
address on a map, I must open the mapping program (for example, Google
maps)
and enter the address into it by hand. Is there any way to open a new
sub-form from the data entry form that I use that opens an internet
browser ,
loads the web address for( for example) Google maps, then loads the
address
for the record showing in the current form into Google Maps and then
displays the map within the new sub-form?
 
D

Douglas J. Steele

Sorry, I can't really suggest any specific book. You'd probably be best off
going to your local bookstore and seeing which of the books they have seem
good to you.

Jeff Conrad points to a number of very good book suggestion lists at
http://home.bendbroadband.com/conradsystems/accessjunkie/resources.html#Books

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


efandango said:
Douglas, Thanks for replying.

Run_point_Address_D is indeed on a control on a different form to the
WebBrowser. Since I posted the questions, I have placed this line of code:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=" &
[Form_Run_Points subform].[Run_point_Address_D]

which works. I did this more through trial and error. It is usually my
syntax that lets me down; do you know of a good resource for Access Syntax
that i can read up on, the MS manuals are ok, but i find them a little too
contextual. What I had in mind was something that describes the rules in
simple terms, such as your comment "The reference to the control needs to
be
outside of the quotes" which is plain english and perfectly
understandable. I
is things like when to, and not to use the [ or a . that baffles me. I
have
never really gone into code too much, preferring to use macros and the
expression builder wizard. But now i'm gaining in confidence and want to
learn more.

Once again, I really appreciated your help.

Thanks.

Douglas J. Steele said:
The reference to the control needs to be outside of the quotes. As well,
your reference does look to be incorrect. If Run_point_Address_D is on
the
same form as WebBrowser, it shouldn't be necessary to worry about the
fact
that the form is being used as a subform:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q=&" &
Me.Run_point_Address_D

should be sufficient.

The tab control name never needs to be used when referring to controls on
the tab: the control names have to be unique, even though they may be
replicated on the various tab pages.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


efandango said:
Hello Doug,

I want to do exactly the same thing that Rod wants; So far I have
managed
to
call up googlemaps in a form, but cannot get my head around how to pass
the
data from a control on another form to the 'webbrowser' code:

I have setup the MS ActiveX Webrowser on a form, and want to be able to
take
the data from a field control on a tabbed form. At the moment i have
the
following code on a 'on click event' set for a button on the same tab
page
as the WebBrowser control:

Me.WebBrowser.Navigate "http://maps.google.co.uk/maps?f=q&hl=en&q= &
[Form_Run_Points subform].Run_point_Address_D"

The WebBrowser works fine, and loads a googlmaps page, but doesn't seem
to
parse the data from the control on the subform tab page. It may be that
this
cannot be done, but i have afeeling it is just my bad syntaxt. Di i
also
have
to specify the 'tab name'? Can you help and tell me where i am going
wrong?


To summarise:
The subform is called: Run_Points subform
The data control is called: Run_point_Address_D






:

See whether my April, 2006 "Access Answers" column in Pinnacle
Publication's
"Smart Access" is of any help.

You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html. While you're
there,
you
might also want to check out the November, 2003 column.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have a database that includes names and addresses, with separate
fields
for
street address, city, and postal code. Currently, if I want to find
the
address on a map, I must open the mapping program (for example,
Google
maps)
and enter the address into it by hand. Is there any way to open a
new
sub-form from the data entry form that I use that opens an internet
browser ,
loads the web address for( for example) Google maps, then loads the
address
for the record showing in the current form into Google Maps and
then
displays the map within the new sub-form?
 

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