Results 1 to 8 of 8
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Range (A2k)

    Is it possible to use a tab control as a date range.
    I would like to create a diary effect form with dates populated on the tab.
    Or if anyone has any interesting demo's I can look at.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Range (A2k)

    Do you want each page of the tab control to display a different day of the month? Or do you want to display a range of dates on one page of a tab control?

    If the former, you can create a tab control with 31pages, set the captions to 1 ... 31, and use code to hide the tabs that are not appropriate for the month (e.g. there is no 31st in November).

    If the latter: in <post#=15613>post 15613</post#>, MarkJ attached a sample database with (among others) a calendar-like form. Although you probably want something different, the code used in that database should be useful to get an idea of how to fill a form with dates on the fly.

    If you want something else entirely, post back.

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

    Re: Date Range (A2k)

    Hi Hans
    My ideal diary would be as your first idea.
    Instead of seeing a calender on a form, I would like mine to possibly emulate a paper type version as you would buy from a bookstore.
    The user can enter free text or pull information from other tables in relation to the date on the tab.
    Ideally the tabs with the dates on could be scrollable.

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

    Re: Date Range (A2k)

    In fact, you don't really need tab pages for this, I think. Create a table with a record for each date you need, and base the form on that table. Then, you can use the standard navigation buttons, or custom command buttons to switch from day to day.

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

    Re: Date Range (A2k)

    Hans
    I think I would rather have some way incrementing the dates, is this possible.
    I saw somewhere a way to increment using the + & - keys.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Range (A2k)

    Dave,

    If you set the KeyPreview property of the form to Yes, you can handle all key events at the form level. Sou you could intercept + and - at the form level to go to the next/previous day.
    The "Popups" database in the post I referred to in an earlier reply uses this technique (for the arrow keys), so you could have a look at that, although it does something different from what you want.

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

    Re: Date Range (A2k)

    Hans
    Take a look at the attachment for the kind of thing I am after.
    As you will see, the form allows the user to use the tglDays more than once at the same time.
    Would their be a way to link each tgl to the date it is showing.
    I'm sure from there, I could then match that to a recordsource or date.
    Attached Files Attached Files

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Date Range (A2k)

    Dave,

    The information you want is maintained by the code behind the form. If you take a closer look at it, you will see how it works:

    The array madDisplay(1 To 31) contains the dates corresponding to each of the tglDaynn toggle buttons. For instance, madDisplay(22) is the date displayed on tglDate22.

    The variables mvSelFrom and mvSelThru contain the dates selected as the From date and Thru date, respectively. If no date is selected, they contain Null.

Posting Permissions

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