salve ragazzi
in un datareport devo inserire del testo in una label
ho provato il seguente codice, ma mi da errore variabile sconosciuta e per variabile intende label1
in pratica non riconosce label1.caption, ho provato anche con rptlabel.caption ma niente da farecodice:Private Sub DataReport_Initialize() Set DatDb1 = New ADODB.Connection DatDb1.CursorLocation = adUseClient DatDb1.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" _& App.Path & "\database\db1.mdb" & ";" Set RecRS = New ADODB.Recordset RecRS.Open "select * from clienti ", DatDb1, adOpenStatic Set Reportclienti.DataSource = RecRS if RecRS!via > "" then Label1.Caption = RecRS!via else Label1.Caption = "Via Sconosciuta" end if End Sub
ciao
gyonny