?
Solved

How To Make Use Of GetDayBold Event For Retrieved Dates From Access Database?

Posted on 2003-03-25
7
Medium Priority
?
1,121 Views
Last Modified: 2007-12-19
I'm doin a date reminder software using vb6. i'm using access database to store reminders. i have a calendar in display (monthview). If there is a reminder on that day, i want the date to be displayed bold on the calendar.

I tried using DayBold property but i realised that it will only bold the days which are visible(in view) on the calendar. So i got to know about GetDayBold event which is used to set the boldness of days as they are brought into view. But i am not sure how to get it work for my situation even though i tried to.

Does anyone know how to make use of the getdaybold event of monthview control to bold the dates retrieved from the database?

This is how i retrieve the stored date from the database, the statements to create connection and stuff are in a module. The statements below are used in form.

strSelect = "SELECT * FROM remind " 'select statement
    lngRemindSelect = ExecuteSelectQuery(strSelect, retrieved()) ' retrieved variables from strSelect
   
        For Row = 0 To lngRemindSelect - 1 ' from 1st to last row in the remind table in database
           
           
            SelectedDate = ConvertToString(retrieved(1, Row)) 'setting all the date values in Column 1 to variable SelectedDate
           
           
        Next Row

Thanks in advance.

Humanity
0
Comment
Question by:InHuman
[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
  • Learn & ask questions
7 Comments
 

Expert Comment

by:itzme
ID: 8202039
I wouldn't use the GetDayBold method why not try the DayBold property of the monthview i.e to set todays date to bold put this code in an action event (i.e click.. it doesnt seem to work inside a form_load sub):

Dim i As Date

i = Date

monthView1.DayBold(i) = True
******************************
In your code this should probable work:
strSelect = "SELECT * FROM remind " 'select statement
   lngRemindSelect = ExecuteSelectQuery(strSelect, retrieved()) ' retrieved variables from strSelect
   
       For Row = 0 To lngRemindSelect - 1 ' from 1st to last row in the remind table in database
           
           
           SelectedDate = ConvertToString(retrieved(1, Row)) 'setting all the date values in Column 1 to variable SelectedDate
           MonthView1.DayBold(SelectedDate)
           
       Next Row
***************************************
where "monthview1" is the name of your monthview
0
 

Author Comment

by:InHuman
ID: 8208999
Hi itzme.

What i need is for it to work without going to any action event and by form_load sub itself. Since this is not possible, i can only rely on GetDayBold event. But from what i have searched, i can only find source codes which bold dates like, all fridays or all saturdays etc.

anyway, thanks.

Humanity
0
 

Author Comment

by:InHuman
ID: 8209028
And one more thing, i mentioned i am using a calendar, I need the days to be bold as they are brought into view. Anyone? Thanks..

Humanity
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:itzme
ID: 8209670
This should work (and do what you want):
/********************************************************************************************/
Private Sub MonthView1_GetDayBold(ByVal startDate As Date, ByVal Count As Integer, State() As Boolean)
 Dim i As Integer  
Dim dateSelected As Date
strSelect = "SELECT * FROM remind " 'select statement
  lngRemindSelect = ExecuteSelectQuery(strSelect, retrieved()) ' retrieved variables from strSelect
 
      For Row = 0 To lngRemindSelect - 1 ' from 1st to last row in the remind table in database
         
          SelectedDate = ConvertToString(retrieved(1, Row)) 'setting all the date values in Column 1 to variable SelectedDate
       dateSelected = CDate(selectedDate)
       i = make_bold(dateSelected)
       State(i - 1) = True          
         
      Next Row
 
   
   
End Sub


Public Function make_bold(ByVal dateBold As Date) As Integer
    Dim i As Integer
    Dim temp As String
    Dim answer As Date
   
    For i = 1 To 42
    Debug.Print MonthView1.VisibleDays(i)
        temp = CStr(MonthView1.VisibleDays(i))
        answer = CDate(Trim(Mid(temp, 1, 10)))
        If answer = dateBold Then
            make_bold = i
        End If
    Next i

End Function
/****************************************************************************************************/
0
 

Accepted Solution

by:
itzme earned 160 total points
ID: 8209681
Get rid of the Debug.print line in the make_bold function, sorry forgot that was in there
0
 

Expert Comment

by:CleanupPing
ID: 8531662
Hi InHuman,
This old question (QID 20562093) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9441116
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept itzme's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

800 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