Results 1 to 4 of 4

Thread: Decipher Code

  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello, I am looking for some guidance on a piece code that I have inherited and am trying to use in a fresh application please. In short I have an existing form that has a calendar control that becomes visible on a button click next to a date field control, default date is today but that is then changed to that selected on the calendar control. On exiting the cal control becomes not visible. Here is the code:

    Private Sub tglSearchDate_Click()
    CalSearchDate.Visible = tglSearchDate
    If IsNull(SearchApptDate) Then SearchApptDate = Date
    CalSearchDate.Value = SearchApptDate

    If CalSearchDate.Visible = False Then
    If Not IsNull(SearchApptDate) And IsNull(SearchSortOrder) Then SearchSortOrder = "Next Appointment"
    End If
    End Sub


    where tglsearchdate is the button
    calsearchdate is the calendar
    seacrhappDate is the date field

    When I try to use this on my application the 'calsearchdate.visible' does'nt recognise the method/object assigned, and to be honest neither do I becuase I only thought it could be true or false.

    Thanks, Darren.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='iksotof' post='769525' date='07-Apr-2009 12:13'][/quote]
    Are you using a toggle button or a command button ? The code is written for a toggle button.
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The value of the toggle button is either True (if it is "down") or False (if it is "up") so you can set the value of the Visible property of the calendar control to the value of the toggle button.

    You need to have a reference to the Microsoft Calendar Control 11.0 library (11.0 is for Office 2003, it'd be 9.0 for Office 2000, 10.0 for Office XP and 12.0 for Office 2007).

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='769529' date='07-Apr-2009 12:08']The value of the toggle button is either True (if it is "down") or False (if it is "up") so you can set the value of the Visible property of the calendar control to the value of the toggle button.

    You need to have a reference to the Microsoft Calendar Control 11.0 library (11.0 is for Office 2003, it'd be 9.0 for Office 2000, 10.0 for Office XP and 12.0 for Office 2007).[/quote]


    Here in a lesson! Thanks guys, I was using a button.


    Cheers, Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •