Results 1 to 3 of 3
  • Thread Tools
  1. Star Lounger
    Join Date
    Jan 2001
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Choose Date/Time in Form Without Typing It (Access 2000 and Win XP Pro)

    I am working with my first database using Access 2000. I have a form and subform. The form is based on a table called Sermons where I fill in the title of a sermon and other related information. The subform is based on a Table called SermonsPreached that shows the dates and locations where this lesson was preached. The view allows me to see the multiple records in tabular form which is what I want.

    Problem - I want to be able to use the DateTimePicker or some other contorl to choose the general date format that includes time as well as date without having to type anything into the DatePreached field of my subform. However, the DateTimePicker with checkbox enabled will not work on a continuous form view but only I believe a singl form view of subform. This is not what I want because I want to be able to see at a glance multiple instances of when a title has been presented. How can I set up my DatePreached field in a subform showing multiple records so I can just doubleclick the filed and then select the Date/Time from a control whether it is the DateTimePicker or not. If I can get theis right, I can begin entering my date. Your help as always most appreciated.

    Gary Hunt

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Star Lounger
    Join Date
    Jan 2001
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Choose Date/Time in Form Without Typing It (Access 2000 and Win XP Pro

    Hans,

    Thanks so much again. I understand the concept of what the end result would be but it will be just a matter of trying to run through the steps you gave to see if I can construct such a workable solution as this. I will faithfully follow these steps and give it a go. I thank you again for your help.

    Gary

  4. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Re: Choose Date/Time in Form Without Typing It (Access 2000 and Win XP Pro

    Create a separate form with a Calendar or DateTimePicker control on it, as well as two command buttons: OK and Cancel. Let's call this form frmPickDate.

    In the OnDoubleClick event of the date text box (txtDate in this example) on the continuous form, open frmPickDate and pass the current value in the OpenArgs argument:

    DoCmd.OpenForm FormName:="frmPickDate", WindowMode:=acDialog, OpenArgs:=txtDate.Text

    In the OnLoad event of frmPickDate, set the value of the calendar or date/time picker control (ctlCalendar in this example):

    If Nz(OpenArgs) = "" Then
    ctlCalendar.Value = Date
    Else
    ctlCalendar.Value = OpenArgs
    End If

    In the OnClick event of the OK button, set the selected date and close the form (in the OnClick event of the Cancel button, just close the form):

    Forms!frmMainForm!frmSubForm!txtDate = ctlCalendar.Value
    DoCmd.Close acForm, Me.Name

    All form and control names should be replaced by their actual names.

Posting Permissions

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