14 Replies - 1357 Views - Last Post: 07 May 2009 - 12:43 AM Rate Topic: -----

#1 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Creating an Application with a Map

Posted 24 April 2009 - 01:41 PM

Am working on a project in creating an application with a map of schools whereby if one clicks on a school attributes about that schools are shown. Is there anyone out there who can help please
Is This A Good Question/Topic? 0
  • +

Replies To: Creating an Application with a Map

#2 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Creating an Application with a Map

Posted 24 April 2009 - 04:09 PM

So you have an image displayed via your form, picturebox, image control, or some other control. Well then, look at whatever you are using to see if it has a mouse move event. If it does then part of those arguements should contain a "Button" arguement. Now, with all of that information, you should be able to capture the x and y of where the user clicked. Then you will have to test the x and y values to see which school they clicked on. From there, you can then display the information you want.

Good Luck
Was This Post Helpful? 0
  • +
  • -

#3 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 27 April 2009 - 05:28 AM

Thanks a lot for that. I have a Map already loaded but im not getting what you are trying to put across can you please explain. thanx in advance
Was This Post Helpful? 0
  • +
  • -

#4 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Creating an Application with a Map

Posted 27 April 2009 - 05:56 AM

This is to capture a point. Just limit the range of the area.
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = X
Label2.Caption = Y
End Sub


Was This Post Helpful? 1
  • +
  • -

#5 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 28 April 2009 - 05:39 AM

iv got to admit yes its about to work but im having trouble determining the X and Y values to use how do i do that?
Was This Post Helpful? 0
  • +
  • -

#6 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Creating an Application with a Map

Posted 28 April 2009 - 05:43 AM

Hard to interpret your question:
Do you mean you cant get the values to display?

Later:
Use something like: If the value of X and the value of Y equals this or that then Some message box appears or a new form appears.
Was This Post Helpful? 0
  • +
  • -

#7 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 28 April 2009 - 07:03 AM

View Postfirebolt, on 28 Apr, 2009 - 04:43 AM, said:

Hard to interpret your question:
Do you mean you cant get the values to display?

Later:
Use something like: If the value of X and the value of Y equals this or that then Some message box appears or a new form appears.



let me try to do that now
Was This Post Helpful? 0
  • +
  • -

#8 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Creating an Application with a Map

Posted 28 April 2009 - 10:21 PM

Please give feedback!
Was This Post Helpful? 0
  • +
  • -

#9 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Creating an Application with a Map

Posted 02 May 2009 - 11:04 AM

If (X > 10 And X < 20) And (Y > 10 And Y < 20) Then
  'Do something
ElseIf...



Good Luck
Was This Post Helpful? 0
  • +
  • -

#10 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 06 May 2009 - 04:50 AM

Ok i did what you said and what i am getting are X and Y values of the points i select on the map. What i want the application to do is this right, i have attributes( the fields being enrollment, number of teachers, capacity,address) of certain schools in a database table
say i click on school A the above fields should be displayed with the data relating to school A
if this is not clear just reply to this thread. thanks in advance
Was This Post Helpful? 0
  • +
  • -

#11 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Creating an Application with a Map

Posted 06 May 2009 - 05:00 AM

Just an example:
Private Sub a_Click()
Form2.Show
End Sub


This post has been edited by firebolt: 06 May 2009 - 05:00 AM

Was This Post Helpful? 0
  • +
  • -

#12 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 06 May 2009 - 06:50 AM

Thanks for that but now how do i get the data in the the database to be reflected?
Was This Post Helpful? 0
  • +
  • -

#13 SLake2000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-May 09

Re: Creating an Application with a Map

Posted 06 May 2009 - 11:44 AM

Create your userform

Add your labels to the userform

Add a command button for them to close it when they are done.

This example will display what is between the marks. If you want it to pull from the data base then you need to give it the reference of where the information is located. It depends on the data base as to how to make the reference. It will probably be along the lines of :

Label1.caption = filename.cell (A1)

Private Sub SchoolA_Click()
 
		UserForm1.Show
		Label1.Caption = "Enrollment"
		Label2.Caption = "Number of Teachers"
		Label3.Caption = "Street Address"
		Label4.Caption = "City, St Zip"
   
End Sub

Private Sub CmdClose_Click()
   UserForm1.Hide
   Unload UserForm1
End Sub


Was This Post Helpful? 0
  • +
  • -

#14 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: Creating an Application with a Map

Posted 06 May 2009 - 09:22 PM

use the mouse down event and set your query string where I have put the 'do something. Then at the end execute the query.

However, if you are using a popup form to show your data you can then set a variable at the 'do something and pass that variable to your popup form through a public sub or use a public variable declared in a module. Then your popup form would read that variable and based upon it, it would query your database for the appropriate information.

Good Luck
Was This Post Helpful? 0
  • +
  • -

#15 tinotenda  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 24-April 09

Re: Creating an Application with a Map

Posted 07 May 2009 - 12:43 AM

thanks guys il give feedback
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1