Inserting Field on Calendar (1 Viewer)

mike60smart

Registered User.
Local time
Today, 21:13
Joined
Aug 6, 2017
Messages
1,913
Hi Everyone

In the attached when you double click on a Date it opens up the Appointments Form

When I add a Location is it possible to have this Location display on the Actual Calendar?

Any help appreciated
 

Attachments

  • Outlook Style Calendar.zip
    129.2 KB · Views: 92

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:13
Joined
May 21, 2018
Messages
8,533
in showMonthAppts
Code:
   'Now copy appt info into each row in array
            Do                                                                  'do--
                vCol = Weekday(vDate, conFirstDay) - 1                          'calc column No for current date
                vRow = (DateDiff("d", vFirstDate, vDate) \ 7)                   'calc row number for current date
                If conMonthHide = 0 Then                                        'if current date <> current month then skip *** (hide appts for dates not in current month)
                    'MajP add location
                    vArray(vCol, vRow) = vArray(vCol, vRow) _
                    & Nz(rst!ApptSubject) & " (" & Nz(rst!apptLocation, "") & ")" & vbCrLf                             'add appt data to array + CRLF
                Else
                    If Month(vMonthStart) = Month(vDate) Then                   'if current date <> current month then skip *** (hide appts for dates not in current month)
                        ' MajP add location
                        vArray(vCol, vRow) = vArray(vCol, vRow) _
                        & Nz(rst!ApptSubject) & " (" & Nz(rst!apptLocation, "") & ")" & vbCrLf           'add appt data to array + CRLF
                      End If
                End If

cal.png
 

mike60smart

Registered User.
Local time
Today, 21:13
Joined
Aug 6, 2017
Messages
1,913
Hi MajP

That works a treat. I would never have been able to work that out for myself.
Many thanks yet again
 

mike60smart

Registered User.
Local time
Today, 21:13
Joined
Aug 6, 2017
Messages
1,913

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:13
Joined
May 21, 2018
Messages
8,533
Need to add the location to everywhere that it only had the subject previously.
change
Code:
vArray(vCol, vRow) = vArray(vCol, vRow)  & Nz(rst!ApptSubject)
add
Code:
vArray(vCol, vRow) = vArray(vCol, vRow) & Nz(rst!ApptSubject) & " (" & Nz(rst!apptLocation, "") & ")"

I put it in Parentheses but you can format this line how you want.
 

Attachments

  • Outlook Style Calendar v2.accdb
    1.1 MB · Views: 76

mike60smart

Registered User.
Local time
Today, 21:13
Joined
Aug 6, 2017
Messages
1,913
Need to add the location to everywhere that it only had the subject previously.
change
Code:
vArray(vCol, vRow) = vArray(vCol, vRow)  & Nz(rst!ApptSubject)
add
Code:
vArray(vCol, vRow) = vArray(vCol, vRow) & Nz(rst!ApptSubject) & " (" & Nz(rst!apptLocation, "") & ")"

I put it in Parentheses but you can format this line how you want.
Hi MajP

Got it to work OK on the Monthly and Weekly but get the following error on the Daily Display.

Click OK and it highlights VCol ???
 

Attachments

  • vRow.jpg
    vRow.jpg
    109.1 KB · Views: 53
  • vCol.jpg
    vCol.jpg
    73.5 KB · Views: 49

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:13
Joined
May 21, 2018
Messages
8,533
It is the exact same syntax in all locations so my guess it is a pasting issue. See if any thing got pasted to the far right. It gets hard to paste with all the inline comments.
 

mike60smart

Registered User.
Local time
Today, 21:13
Joined
Aug 6, 2017
Messages
1,913
It is the exact same syntax in all locations so my guess it is a pasting issue. See if any thing got pasted to the far right. It gets hard to paste with all the inline comments.
I added Dim vCol as Long and it works just fine now

Many thanks for the quick response.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:13
Joined
May 21, 2018
Messages
8,533
I see what you did. You pasted in the whole line, not just the addition For the day it was this a little different.
vArray(0, vRow) = vArray(0, vRow) & rst!ApptSubject & " (" & Nz(rst!apptLocation, "") & ") "

In the other ones there was a vCol but for day it is just 0
vArray(vCol, vRow) = vArray(vCol, vRow) & rst!ApptSubject & " (" & Nz(rst!apptLocation, "") & ") " 'add appt data to array
 

Users who are viewing this thread

Top Bottom