Results 1 to 13 of 13
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Problem returning Date from Control?
    A2k (9.0.3821) SR-1

    I have a form with date control that has an Double Click with =PopupCalendar([Screen].[ActiveControl]) and it works OK.

    I
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    The returned value is ignored for a function you put in an Event property. Therefore, everything you want done you must do in the called function. I'd do it this way:
    =PopupCalendar([txtDate2])

    I assume your function is probably defined something like this:
    Public Function PopupCalendar(ctl as control)

    So, all you need to do is add a line in this function: ctl = selectedDate
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Hi Mark

    The reason I wanted to put it in the [Event Procedure] was so I could conditionally fire an after upde event

    Private Sub txtDate2_DblClick(Cancel As Integer)

    Me.txtDate2 = PopupCalendar(Screen.ActiveControl)

    txtDate2_AfterUpdate ' Opt/Mod

    End Sub

    How would I have to change popup mod to accommodate this

    John

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Sorry to butt in , but does this help.
    Attached Files Attached Files

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wetherby, Yorkshire, England
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    I could be on the wrong track here - and I apologise in advance for also butting in. But if all you want is today's date in your control why use the popup calendar? Why not
    Private Sub txtDate2_DblClick(Cancel As Integer)

    Me.txtDate2 = Date
    end sub

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    What I found was to replace the line:
    ' Me.txtDate2 = PopupCalendar(Screen.ActiveControl)
    with
    Call PopupCalendar(Me.txtDate2)

    HTH
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    John,

    Well I'm confused. I guess I misread your first post, but I thought you had it in a event procedure, but wanted to move it to a simple function that would be in the DblClick property?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Just a thought, I think this thread is solved, but there a ton of form based popup calendars out there. (I have one on my site.). This doesn't seem like a very tricky issue, but having a form based calendar has several advantages. The biggest is that you are not using an ActiveX control that must be setup on the client machines. The second, you have code that you can modify, to custom fit the application.

    Drew

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Hi Drew

    I tried downloading minicalndar several times when opening in both a97 & a2k access closes and I'm returned to the desktop.

    Any suggestions?

    Thanks, John

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Hi Pat

    That seems to work.

    Just to review for others this is a calendar, calculator, text popup that Mark L posted a while ago.

    I have a form with date control that has an Double Click with =PopupCalendar([Screen].[ActiveControl]) and it works OK.

    I

  11. #11
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Hi Dave

    I see the form in the db you posted, where is the pickdate function?

    John

  12. #12
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    Sorry about that. In 97, when Access 'disappears' you should have a form on your desktop. In 2000, it's a version issue. Access 2000 handles windows a bit differently. In either case, Access is still running. I have a module that hides/shows the Access window, and I put it in the MiniCalendar to show how to use it. There is a AutoKeys macro, where if you hit Ctrl-A, Access will show (and repeating that will hide it again.).

    One tip, a lot of sample databases have initial startup code. The MiniCalendar hides Access, however some are live dbs, that someone posts a portion for sample usage. A lot of times in those cases, there is startup code that fails, since either part has been disabled, or it is looking for a network resource that doesn't exist. You can bypass any access databases startup routines by holding the shift key down. You can disable the ShiftBypassKey through code, for your own applications (to prevent users from bypassing your startup stuff), but I have yet to see a sample database that had the ShiftBypassKey disabled.

  13. #13
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem returning Date from Control? (A2k (9.0.3821) SR-1)

    John I use the calender as posted earlier, to control a subform, showing currently booked out cars.
    Its an activeX one though, but quite easy to manipulate.
    See code and pic attached.

    You may have to register it first. MSCAL.Calendar.7

    I 've previously been quite succesful with the date & tima picker.

    As said earlier, their are loads of different variations on the web.
    Attached Files Attached Files

Posting Permissions

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