Inserting Field on Calendar

mike60smart

Registered User.
Local time
Today, 05:30
Joined
Aug 6, 2017
Messages
2,169
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

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
 
Hi MajP

That works a treat. I would never have been able to work that out for myself.
Many thanks yet again
 
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

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: 107
  • vCol.jpg
    vCol.jpg
    73.5 KB · Views: 98
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.
 
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.
 
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

Back
Top Bottom