Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    usa
    Posts
    5

    Red face Unanswered: Pop Up Calendar for Office XP Multi Feilds

    I am new to this forum but find alot of good advice which has helped me. Thank you. I am asking for anyones help on a database I am creating for the first time for my company. I apologize if this get to long. I am not a VB programmer but I needed to add a pop up calender to about 7 or 8 date fields in my form and found the Access Tips Instructions at http://www.fontstuff.com/access/acctut09.htm
    I had success on the first field I tried. Now, when I try to continue the instructions on the sceond field, it does not work. After the success on the first field, i went back to design view, changed the field on the 2nd box to a combo box. I then went to view code. I tried 2 variables since I do not know if 2002 is different or not. It does not come up with Option Explicit after Option Compare Database so I tried once by addding this then Dim cboOriginator as ComboBox
    And once without.
    Second:
    Option Compare Database
    Dim cboOriginator As ComboBox


    Private Sub ACTIVITYDATE_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Set cboOriginator = cboStartDate
    ocxCalendar.Visable = False
    ocxCalendar.SetFocus
    If Not IsNull(cboOriginator) Then
    ocxCalendar.Value = cboOriginator.Value
    Else
    ocxCalendar.Value = Date
    End If


    End Sub

    Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ocxCalendar.Visible = True
    ocxCalendar.SetFocus
    If Not IsNull(cboStartDate) Then
    ocxCalendar.Value = cboStartDate.Value
    Else
    ocxCalendar.Value = Date
    End If

    End Sub

    Private Sub ocxCalendar_Updated(Code As Integer)
    cboOriginator.Value = ocxCalendar.Value
    cboOriginator.SetFocus
    ocxCalendar.Visible = False
    Set cboOriginator = Nothing


    End Sub

    Neither way works for me. Also at the end of these instructions, it says:
    A final line:
    Set cboOriginator = Nothing
    ...empties the variable, ready for the next call.

    Where does this go? I already put that line in.
    If anyone could help me, I would really appreciatate it. I have tried hours to fix this. Also, if I cannot get it to work this way, is there a way to just do each one seperatly? I have spent many hours just trying to get this to work.
    Thank you in advance

  2. #2
    Join Date
    Jan 2004
    Posts
    75

    Re: Pop Up Calendar for Office XP Multi Feilds

    The code should work fine...

    Check out this article first about registering the calendar control:

    http://www.microsoft.com/officedev/tips/regactx.htm

  3. #3
    Join Date
    Feb 2004
    Location
    usa
    Posts
    5

    Re: Pop Up Calendar for Office XP Multi Feilds

    Originally posted by datagen1
    I am new to this forum but find alot of good advice which has helped me. Thank you. I am asking for anyones help on a database I am creating for the first time for my company. I apologize if this get to long. I am not a VB programmer but I needed to add a pop up calender to about 7 or 8 date fields in my form and found the Access Tips Instructions at http://www.fontstuff.com/access/acctut09.htm
    I had success on the first field I tried. Now, when I try to continue the instructions on the sceond field, it does not work. After the success on the first field, i went back to design view, changed the field on the 2nd box to a combo box. I then went to view code. I tried 2 variables since I do not know if 2002 is different or not. It does not come up with Option Explicit after Option Compare Database so I tried once by addding this then Dim cboOriginator as ComboBox
    And once without.
    Second:
    Option Compare Database
    Dim cboOriginator As ComboBox


    Private Sub ACTIVITYDATE_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Set cboOriginator = cboStartDate
    ocxCalendar.Visable = False
    ocxCalendar.SetFocus
    If Not IsNull(cboOriginator) Then
    ocxCalendar.Value = cboOriginator.Value
    Else
    ocxCalendar.Value = Date
    End If


    End Sub

    Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ocxCalendar.Visible = True
    ocxCalendar.SetFocus
    If Not IsNull(cboStartDate) Then
    ocxCalendar.Value = cboStartDate.Value
    Else
    ocxCalendar.Value = Date
    End If

    End Sub

    Private Sub ocxCalendar_Updated(Code As Integer)
    cboOriginator.Value = ocxCalendar.Value
    cboOriginator.SetFocus
    ocxCalendar.Visible = False
    Set cboOriginator = Nothing


    End Sub

    Neither way works for me. Also at the end of these instructions, it says:
    A final line:
    Set cboOriginator = Nothing
    ...empties the variable, ready for the next call.

    Where does this go? I already put that line in.
    If anyone could help me, I would really appreciatate it. I have tried hours to fix this. Also, if I cannot get it to work this way, is there a way to just do each one seperatly? I have spent many hours just trying to get this to work.
    Thank you in advance
    I registered the Mscal.ocx. No good.
    I get a run time error after I apply this when I click on the Calendars first field that worked earlier Error 438. and it displays this on the debug:
    Option Compare Database
    Dim cboOriginator As ComboBox



    Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Set cboOriginator = cboStartDate
    ocxCalendar.Visable = False
    ocxCalendar.SetFocus
    If Not IsNull(cboOriginator) Then
    ocxCalendar.Value = cboOriginator.Value
    Else
    ocxCalendar.Value = Date
    End If

    End Sub

    Private Sub ocxCalendar_Click()
    ocxCalendar.Visible = True
    ocxCalendar.SetFocus
    If Not IsNull(cboStartDate) Then
    ocxCalendar.Value = cboStartDate.Value
    Else
    ocxCalendar.Value = Date
    End If


    End Sub

    Private Sub ocxCalendar_Updated(Code As Integer)
    cboOriginator.Value = ocxCalendar.Value
    cboOriginator.SetFocus
    ocxCalendar.Visible = False
    Set cboOriginator = Nothing

    End Sub
    Where 'ocxCalendar.Visable = False' is highlited Yellow in the:
    'Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)'
    And the second field where I applied it, does not work.
    Any ideas? Thank you for the reply. I am using version 10.0 XP

  4. #4
    Join Date
    Feb 2004
    Location
    usa
    Posts
    5

    Unhappy Ok Calendar for multi date feilds

    I have made some progress!!!!!
    I have the calendar now that it pops up when clicking each combo box on a date feild!. But ... It always reverts back to the first feild. What am I doing wrong? can someone help?

  5. #5
    Join Date
    Feb 2004
    Location
    usa
    Posts
    5

    Talking POP UP CALENDAR

    If SetFocus is the answer, I have set focus on, ocxCalendar, cboStartDate, this is driving me crazy

Posting Permissions

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