Go Premium for a chance to win a PS4. Enter to Win



Posted on 2003-11-12
Medium Priority
Last Modified: 2011-09-20
There is a class called clsSunrise downloadable from freevbcode.com that contains the computations for sunrise, sunset, etc. I have been unable to write the code to access and use this class, can someone write a small aplication showing how to use this class and the functions contained in it?
Question by:ralphy

Accepted Solution

monvelasquez earned 2000 total points
ID: 9736983
here's some sample code

Dim Sun As New clsSunrise

Sun.City = "Hong Kong, China"
Sun.DateDay = #11/14/2004#

Debug.Print Sun.Sunrise
Debug.Print Sun.SolarNoon
Debug.Print Sun.Sunset

Set Sun = Nothing


the list of cities are located in the class itself..
you can add more cities in the InitCities method using the AddCity method provided
you know the Latitude, Longitute, and time zone of the city you're adding..
LVL 22

Expert Comment

ID: 9737056
'Using a pre-defined city. Optionally you can individually set Latitude, Longitude, TimeZone , DaySavings, and DateDay
'Initiates as todays date but you can specify date with Property DateDay.
Option Explicit

Dim cSunrise As New clsSunrise

Private Sub Form_Load()
   With cSunrise
      .City = "Boston, MA"
      Debug.Print .Sunrise, .Sunset
   End With
End Sub

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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

877 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