MS Access Calendar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scootaman
    New Member
    • Feb 2010
    • 22

    Originally posted by ADezii
    In the Close() Event of the Training Details Form:
    Code:
    Private Sub Form_Close()
    'Explicitly Set Focus to the Calendar Form
    Forms![frmCalendar].SetFocus
    
    'Activate the Shortcut Key for the Sync Command Button
    SendKeys "%S", True
    End Sub
    Perfect! Perfect! You made my day! Thanks so much for all your help!

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      Youo are quite welcome. enjoy the Application.

      Comment

      • scootaman
        New Member
        • Feb 2010
        • 22

        Double clicking on the bottom box

        ADezii

        Is it possible to make a double click on a record that shows in the bottom LstEvent box to open my Training Events Detail to open to the record shown? I tried a typical macro to open the record by the ID but I get a function error.

        I thought it would be nice to open a record that way if there was a date or other change that needed to be made.

        Thanks

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          In the lstEvents_DblCl ick() Event:
          Code:
          Private Sub lstEvents_DblClick(Cancel As Integer)
            DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit
          End Sub

          Comment

          • scootaman
            New Member
            • Feb 2010
            • 22

            Thanks

            I'll add this on Monday when I get back to work! Thanks for the prompt reply. Your Calendar is really cool!!

            Comment

            • scootaman
              New Member
              • Feb 2010
              • 22

              Originally posted by ADezii
              In the lstEvents_DblCl ick() Event:
              Code:
              Private Sub lstEvents_DblClick(Cancel As Integer)
                DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit
              End Sub
              ADezii,

              How do I get the form to open in dialog mode? The form is opening in the tab behind the Calendar where I can't get to it without closing the Calendar. It is, however, finding the right record.

              When I tried:
              Code:
              Cmd.OpenForm "Training Events Details", acNormal, , , , acDialog, "[ID] = " & Me![lstEvents].Column(0), acFormEdit
              I recieved the error messae that says , "Wrong number of arugments or Invalid property Assignment. If I take the ", acFormEdit" off the end of the code the form will open in dialog mode but goes the the first record in the table instead of the record I clicked on. Your help is greatly appreciated.

              Thanks

              Comment

              • scootaman
                New Member
                • Feb 2010
                • 22

                ADezii,

                Never mind, I figured it out. I was putting AcDialog in the wrong place. This code worked:
                Code:
                DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
                Thanks for such a cool calendar!!

                Comment

                • scootaman
                  New Member
                  • Feb 2010
                  • 22

                  Small bug

                  ADezii,

                  I found a small bug in the Double click event for the lstEvents box. If only one record shows in the box and I accidentally click on the open space below the record, but within the box, I get a run time error that says there is a Syntax error or missing operator in the query expression ID =

                  If I Choose End instead of Debug on the error message, the calendar stops functioning and I have to exit. Is there a way to fix this?

                  Comment

                  • scootaman
                    New Member
                    • Feb 2010
                    • 22

                    Adezii,

                    I've kinda fixed the bug for now by adding an On Error GoTo statement so now a user will get a message to double click on the record instead of the runtime error.
                    Code:
                    Private Sub lstEvents_DblClick(Cancel As Integer)
                    On Error GoTo Error_lstEvents_dblclick
                     DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
                    
                    Exit_lstEvents_dblclick:
                    Exit Sub
                    
                    Error_lstEvents_dblclick:
                    MsgBox "Please double click on the record.", vbInformation + vbOKOnly, "No Record Selected"
                    
                    Resume Exit_lstEvents_dblclick
                    
                    End Sub
                    Is this the best way to handle this? It works for now.

                    Thanks
                    Last edited by NeoPa; Feb 10 '10, 12:49 PM. Reason: Please use the [CODE] tags provided

                    Comment

                    • ADezii
                      Recognized Expert Expert
                      • Apr 2006
                      • 8834

                      Code:
                      Private Sub lstEvents_DblClick(Cancel As Integer)
                      If Not IsNull(Me![lstEvents].Column(0)) Then
                        DoCmd.OpenForm "Training Events Details", acNormal, , "[ID] = " & Me![lstEvents].Column(0), acFormEdit, acDialog
                      Else
                        MsgBox "You must Dbl-Click on a specific Record and not on an Emply Space " & _
                               "in the List Box", vbExclamation, "No Record Selected"
                      End If
                      End Sub

                      Comment

                      • scootaman
                        New Member
                        • Feb 2010
                        • 22

                        That works great Thanks!

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32634

                          So you shouldn't click on emply spaces then ADezii?

                          Comment

                          • ADezii
                            Recognized Expert Expert
                            • Apr 2006
                            • 8834

                            Originally posted by NeoPa
                            So you shouldn't click on emply spaces then ADezii?
                            That would appear to be the Lesson Learned for the day, NeoPa. (LOL).

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32634

                              What about empty ones then?

                              Comment

                              • scootaman
                                New Member
                                • Feb 2010
                                • 22

                                Populate temp table with Calendar form closed

                                ADezii

                                My Training Events Details form can be opened from my Main Events form or the Calendar. I've added a list box on the form that show all the records that occure on the date selected in the [Start Date] field. The data for the list box is drawn from the temp table. I chose the temp table because I like how your temp table splits up a record that contains start and end dates that spands several days. The list box is meant to act like a calendar day view. The only small draw is when the form is opened from my main form instead of the calendar and records are entered. These new records will not show in the listbox because they don't exist in the temp table. Is there away to repopulate the temp table on closing my Details form while the Calendar form is not open? I tried an append query but I didn't like the way it works because I found it I could end up with duplicate records. Especially if the form was open to a specific record to change a detail. The duplicates, of course, went away once I opened the calendar.

                                The tempory duplicates don't bother me, but I don't want to confuse any other person who may end up using this database.

                                Thanks

                                Comment

                                Working...