Solved

united states map reporting

Posted on 2004-09-02
5
171 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now