Moderatori: Anthony47, Flash30005
Ad esempio fai una funzione simile a questail giorno avere un colore differente
Private Function get_events(p_date As Date) As Long
If DCount("*", "impegni", "giorno=#" & p_date & "#") = 0 Then
get_events = 16711680
Else
get_events = RGB(255, 255, 0)
End If
End Function
ctl.ForeColor = 16711680
ctl.ForeColor = get_events(DateSerial(intYear, intMonth, intJ))
Visualizza dove? E se ci sono più impegni nello stesso giorno?se si clicca sopra, visualizza l'impegno del giorno
Quando ho detto al posto della riga intendevo che devi cercare, nel codice già esistente, la riga con l'istruzione ctl.ForeColor = 16711680, cancellarla e mettere al suo posto (cioè nella stessa posizione dentro al codice) quella da me suggerita: ctl.ForeColor = get_events(DateSerial(intYear, intMonth, intJ))Francesco53 ha scritto:La prima volta mi ha dato errore non trovava variabile intJ, ho provato a inserirla, e non mi dava più l'errore, ma non evidenziava ugualmente i giorni.
Sub ResettaColore(CodToggleButton As String)
'CodToggleButton sono le ultime due lettere del nome del ToggleButton in Me.optCalendar.
'Resetta al colore blu tutti i ToggleButton rossi in in Me.optCalendar (eccetto quello che lancia la sub).
Dim i As ToggleButton
For Each i In Me.optCalendar.Controls
If Right(i.Name, 2) = CodToggleButton Then
Me!Impegni.Form.RecordSource = "select riunione from impegni where giorno=#" & DateSerial(Me!cmbYear, Me!cmbMonth, i.Caption) & "#"
Me!Impegni.Form.Requery
Else
If i.ForeColor = 255 Then 'Rosso
i.ForeColor = 16711680 'Blu
End If
End If
Next i
End Sub
'CodToggleButton sono le ultime due lettere del nome del ToggleButton in Me.optCalendar.
'Resetta al colore blu tutti i ToggleButton rossi in in Me.optCalendar (eccetto quello che lancia la sub).
Dim i As ToggleButton
For Each i In Me.optCalendar.Controls
If Right(i.Name, 2) = CodToggleButton Then
Me!Impegni.Form.RecordSource = "select riunione from impegni where giorno=#" & DateSerial(Me!cmbYear, Me!cmbMonth, i.Caption) & "#"
Me!Impegni.Form.Requery
Else
If i.ForeColor = 255 Then 'Rosso
i.ForeColor = get_events(DateSerial(Me!cmbYear, Me!cmbMonth, i.Caption)) 'Blu
End If
End If
Next i
End Sub
Torna a Applicazioni Office Windows
Access 2003: creare maschera per inserire dati su più tabell Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 1 |
Sincronizzazione Google Outlook calendario=no va!!!! Autore: mp420 |
Forum: Software Windows Risposte: 1 |
Access 2003: funzione per contare dati Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 1 |
Access 2003: contatore maschera sballato Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 1 |
Visitano il forum: Nessuno e 17 ospiti