MAPPING THE REGION - I notice some people write logbook program with a map showing a station's location. I am not smart enough to design a hitech digital map. So I decide to borrow some other people's map. I got those maps from the internet.

I create a database with fields name a. Prefix  or callsign   b. Area / kawasan  c. Country    d. Coordinate X    e. Coordinate Y.

I must first key in data; all prefixes and country name / area name. Enter these data in any way you want. You might to design data entry program or use access database etc. 

I use 2 command button, a timer,several text boxes and an image control. Command1 button is resize to 2 X 2 cm. The timer is used to blink it.

If Command1.BackColor = QBColor(12) Then
Command1.BackColor = QBColor(0)
Else
Command1.BackColor = QBColor(12)
End If

                                                                                                   The Menu Editor is used to list the maps.

                                                                                                  Private Sub carib_Click()
                                                                                                  neg = "caribean.gif"
                                                                                                  Call Command2_Click
                                                                                                  End Sub


                                                                         Private Sub Command2_Click()
                                                                                                 Image1 = LoadPicture("c:\ham1\" + neg + "")

                                                                         Me.Width = Image1.Width
                                                                                                 Me.Height = Image1.Height
                                                                                                 End Sub

Command2 button merely load a map. Here the map is located in ham1 folder. You have to declare the neg. Window size is the map size. My intention is to record a place location. I use the coordinates on my screen map instead of the real world latitude and logitude. If I decide to map Southeast Asia then I have to put the map on using the pulldown menu. I look for a country. Say SAUDI ARABIA with prefix HZ. I click on Saudi Arabia's map. Command1 button will come to the point Ijust clicked. To record the corordinate, I just click on the command1 button.

Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.Caption = "X=" & x & " Y=" & y
m = x: n = y
End Sub

Private Sub Image1_Click()
Command4.Left = m: Command4.Top = n : ' bring command1 button where it is clicked
End Sub

Private Sub Command1_Click()
Text4 = m: Text5 = n : ' coordinates on the image is recorded
End Sub

DATA RETREIVAL - Now we want to retreive the data. We want to enter a callsign or prefix and we want it to show on the map. I use two modules namely lokasi.frm and peta.frm ( map ). This program is separate from the previous one.

Dim ada, last, prefix

Private Sub Check6_Click()
On Error GoTo kel
If Check6.Value = 1 Then
Data1.RecordSource = "select * from negeri where ucase(callsign) like '" + UCase(prefix) + "'"
Data1.Refresh
If Data1.Recordset.kawasan = "HZ" Then peta.Image1 = LoadPicture("c:\ham1\mideast.gif")
If Data4.Recordset.kawasan = "JA" Then peta.Image1 = LoadPicture("c:\ham1\JAPAN.gif")

peta.Image1.Top = 0: peta.Image1.Left = 0
peta.Width = peta.Image1.Width: peta.Height = peta.Image1.Height
peta.Command1.Left = Val(Data1.Recordset("x") & "")
peta.Command1.Top = Val(Data1.Recordset("y") & "")
peta.Show
Else
Unload peta
Set peta = Nothing
kel:
End If


End Sub

Private Sub Command1_Click()
End
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text2_Change()
Data1.RecordSource = "select * from negeri where ucase(callsign) like '" + UCase(Text2) + "'"
Data1.Refresh
If Len(Trim(Text4)) > 0 Then last = Text4: prefix = Text2: ada = 1 
If ada = 1 And Len(Trim(Text4)) = 0 Then Text4 = last:
End Sub

 

The coding on the left is not good. You have to do your own codings. Text2 is the yellow box above. As you type it will scan your database. If in your database you only have HZ for Saudi Arabia, once it is displayed in the text box below it, it will pass the country name to variable last and prefix to variable prefix. So if you enter HZ2, the variableassignments wil not proceed anymore unless you have HZ2 as a prefix in your database.

Private Sub Form_Activate()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
End Sub
Private Sub Image1_Click()
Lokasi.Check6.Value = 0
Unload Me
Set peta = Nothing
End Sub
Private Sub Timer1_Timer()
If Command1.BackColor = QBColor(12) Then
Command1.BackColor = QBColor(0)
Else
Command1.BackColor = QBColor(12)
End If
End Sub

That's the whole coding for peta.frm. Notice the command button in black. It is actually blinking between red and black.