Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar (Access 97)

    I have a calendar in a data entry form that I would like to show up as a pull down box. For example, I would like the data entry person to click on a box that would pop out a calendar to select the date, then the calendar would disappear showing only the date that was selected.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    You could try using the date/time picker instead of the calendar control. The date/time picker is exactly like the MonthView calendar control, but it functions as a dropdown. It is in the MSComCt2.ocx library (Microsoft Windows Common Controls-2 6.0 (SP4)), so I assume you need VB 6 to use it, but it does exactly what you're trying to do.

    Perhaps a better alternative for 97 would be to create a popup form with your calendar control on that. Open the calendar form as a dialog and use code to pass the selected date back to the calling form. It would be easiest to do this using automation from within the calling form through the WithEvents keyword. How familiar are you with that technique? If you want to try it, post back and I'll help.
    Charlotte

  3. #3
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    Thank you so much. I did it as a pop-up. I'm not familiar with the WithEvents keyword and I'd like to try it. Could you help?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    I'm attaching a zipped sample database in Access 97 format that demonstrates the use of the WithEvents keyword to automate forms and reports.

    If you look at the code behind the forms, you'll see how it works. When you click the View Demo button, you'll see a menu form. When you select the Forms demo on that, you pick a company and then another form opens to display that record. When you close the latter, you'll see a messagebox telling you which record you were on. The messagebox and the code for the close button are actually on the calling form, which uses the WithEvents keyword.
    Attached Files Attached Files
    Charlotte

  5. #5
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    Thank you very much. This is information that I can really use. <img src=/S/rose.gif border=0 alt=rose width=15 height=15>

  6. #6
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    I've set up my calendar in a subform form. I've linked the date entered to a "Date of Contact". When I'm in the main form and use the calendar to select my date, it doesn't enter anything in. However, when I'm in the sub-form alone, the date gets entered in.

    What am I doing wrong?

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    Using the WithEvents approach?? It sounds like you're saying you put your calendar control on the subform rather than on a popup. So where is the date field you're trying to set, on the form or on the subform? If the data field is on the form, you have to properly reference it from a subform, but you can do that using the Parent object of the subform.
    Charlotte

  8. #8
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    No I'm not using the WithEvents approach (I chickened out and since I don't know VB very well, I don't have time work with it. I'll have to use it with another database). I created a subform with the calender on it as a pop-up and specified the control source as "Date of Contact". In the Data Entry form I'm using the Calendar button from a subform.

    Is there another way I should have done the Pop-Up Form?

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    No, popups are not subforms, they're separate forms that you launch as dialogs from a calling form, menu, etc. Subforms are forms that are actually attached to a parent form through a subform control. So I'm not sure whether you're calling subforms popups or popups subforms! <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    The control source of what, the calendar control? Why would you make the control source of the calendar control a field on a different form? And what do you mean by calendar button? Are we talking about the date/time picker here, or a button to show the calendar?

    I'm attaching a sample database that uses two date/time pickers on a form. Maybe that will give you some ideas.

    EDITED after posting
    <font color=red>Sorry, that's an Access 2000 database, so it won't be of any use to you because you won't be able to open it. Unfortunately, I don't have an Access 97 version.</font color=red>
    Attached Files Attached Files
    Charlotte

  10. #10
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    Okay, let me start over. This is the end result of how I want my data entry form to look.

    I want the data entry person to enter a Contact date, then move to the "Date of Contact" field. Here I want them to be able to click a button that will bring up a calendar, click on the date of the contact, click "OK" the calendar goes away and the date that was selected on the calendar gets entered into the "Date of Contact" field.

    Does this make things any clearer? Please bear with me.

  11. #11
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    <hr>enter a Contact date, then move to the "Date of Contact" <hr>
    Is entering a contact date different than using a calendar control to select a date? Or do you mean enter the record and then use the calendar to select a date of contact?

    I'm still not clear on where you calendar control is. Is it on a totally separate form that pops up like a dialog or is it embedded in your parent form or on a subform? You don't really need all those buttons if you always want users to use the calendar control to select a date. You can use the Enter event of the date of contact field to make the calendar available and whatever the appropriate event of the calendar control to write the data back to date of contact and and close or hide the calendar.
    Charlotte

  12. #12
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    Okay, how do I use the Enter event of the date of contact field to make the calendar available and whatever the appropriate event of the calendar control to write the data back to date of contact and and close or hide the calendar.

    That's exactly what I want to do.

  13. #13
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    You have to answer the rest of the questions first. I can't tell you how to do it without the rest of the information about forms, subforms, etc. If I just jump into a "here's how you do it" response, it has at least a 50-50 chance of being the wrong answer for what you're actually doing.
    Charlotte

  14. #14
    Lounger
    Join Date
    Jul 2002
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar (Access 97)

    I want them to use the calendar control to enter the date that will go into the contact date field. Whether it's in a subform or pop-up dialogue box, I (obviously) have no idea. I do know that I want it to appear only when they are going to enter a date.

  15. #15
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calendar (Access 97)

    Are you saying that you don't have anything designed yet? Then what did this mean?
    <hr>I did it as a pop-up<hr>

    And by the way, if you're planning to create an application for multiple users, do you have the Office Developer's edition or VB Pro installed? Otherwise, you can't distribute activex controls, and they have to be installed on each machine that uses the application.
    Charlotte

Page 1 of 2 12 LastLast

Posting Permissions

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