Need Some Help with Visual Basics and Sub Functions !!!

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
i am trying to do a program for school and it deals with a mail delivery system and if it is on a city grid of avenues and streets. I want to do it with if statements for the problem tree

first i have cut up the address into varibles and i am testing to see if it is a street or an avenue...i am fine until here....once i am in the decision tree and get to if it is either a street or an avenue i am calling another sub function inside the function to decide weather it is a street or avenue...it looks like this


Private Sub AvenueOrStreet(RoadType As String, BuildingNumber As Single, StreetOrAvenueNumber As Single)
If RoadType = "Street" Then

Call AvenueDeliiveryLocation(BuildingNumber, StreetOrAvenueNumber)
Else

Call StreetDeliveryLocation(BuildingNumber, StreetOrAvenueNumber)

End If

End Sub

i am sending the first sub function roadtype, building number and street or ave number....it is only going to be a street or ave so that is why i only used one if statement....but it gives me an error that says

sub or function not defined Call AvenueDeliiveryLocation...i really don't know why it is doing this ???

if anyone can give a little insight to this problem i would be all ears !!!!

thanks in advance

leeland
 

UThomas

Senior member
Apr 18, 2000
251
0
0
Perhaps the sub functions are not public or global?

Its probably an issue of permissions.

Thomas
 

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
thanks for the reply
i fiqured it out....basically....i named them wrong...and i don'tk now if this is right but they were private and i changed the names and make them public

so i got it to work, now it is the logic that is a b!tch

thanks again

leeland