Solved

# united states map reporting

Posted on 2004-09-02
174 Views
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
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

LVL 22

Expert Comment

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

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

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

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

LVL 22

Accepted Solution

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
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

Question has a verified solution.

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

### Suggested Solutions

Copy a row 12 75
MS Access 03, TransferText, decimal places 8 92
pop out of webbrowser1 control vba6 5 51
VBA - If Bookmark = "XXBOOKMARKXX" then 15 66
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
###### Suggested Courses
Course of the Month6 days, 17 hours left to enroll