Solved

united states map reporting

Posted on 2004-09-02
5
173 Views
Last Modified: 2010-05-02
my boss has asked me to create a report with a map of the united states as shown at this web address http://www.yourchildlearns.com/us_map.htm.  what he wants is to show a dot in a state that has a contact record and next to the dot show the contact name from the database.
does any one have a way to do this??  

thanks
0
Comment
Question by:nafty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11966920
So you just want to display this information?

You can put this image into a picturebox, and store the coordinates for each state... then want you want to display the contact, you can draw a dot on a picturebox on a state's coordinates... then create a new label (create lable array first), fill it with data and move it to same coordinates... just ask if you need more specific help...

Darko
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 11966966
Hey, man,
Be aware  that most of the world is outside the US.
First of all, are you working with the website, or just a map that looks like that?
If the latter than you could prepare a map with precise colours for each state and let the point(x,y) value determine the chosen area. If you are forced to have the same colour value for different areas, then you must map the distinction in code:

Function StatetSelected(x a single. y as single) as integer

Select Point(x,y)
      Case vbRed
             If x > 100 and x < 300 and y > 500 and y < 600 then
                   StatetSelected= MyConstWyoming
             Else
                   StatetSelected= MyConstFlorida
             end if

etc

           
0
 
LVL 76

Expert Comment

by:David Lee
ID: 11968250
You mentioned a report.  What kind of report?  If you mean a printed report, then I'd think Visual Basic isn't the best way to go.  If you mean something interactive like the web page with the map, then you could modify the Javascript routine that map pages uses to display the capitals.
0
 

Author Comment

by:nafty
ID: 12002107
DarkoLord, i like your suggestion can you give me a little more to get started with
0
 
LVL 22

Accepted Solution

by:
DarkoLord earned 500 total points
ID: 12005998
Sure...

Create a picturebox (set its AutoRedraw property to True) and load your map into it... then use this function to get the coordinates of the point you want your dot to be displayed on...

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
   Debug.Print X, Y
End Sub

So when you click on each state (capital city or whatever..) you will get coordinates of that point...
Then store this coordinates in a array or something... Then create a label ON a picturebox and set it's Index property to 0 and Visible to false...
use this function to draw a dot on specified coordinates and show a new label there:

Private Sub Command1_Click()
    Picture1.DrawWidth = 10 'dot diameter
    Picture1.Line (945, 945)-(945, 945) 'change with your x and y
    Load Label1(Label1.Ubound + 1)
    Label1(Label1.Ubound).Move 995, 995 'move a label a little bit down and right so it's not on top of the dot...
    Label1(Label1.Ubound).Caption = "Howdie"
    Label1(Label1.Ubound).Visible = True
End Sub

So basically what you just need to do is to look up the coordinates of the state (from array or table) and then change the caption of a label...

Darko
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 278
How to Add / Edit Windows Menu 4 73
Visual Studio 2005 text editor 10 48
VB script to continue despite error 2 48
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question