Torna al Thread

Private Sub cmd_preview_Click() Dim badge as variant Me.cmb_nbadge.SetFocus If cmb_nbadge.Text = "" Then badge = "IS NOT NULL" Else badge = "=" & Me.cmb_nbadge.Text End If Dim group as variant Me.cmb_gruppo.SetFocus If cmb_gruppo.Text = "" Then group = "IS NOT NULL" Else group = "=" & Me.cmb_gruppo.Text End If If Me.cmb_ord.Value = "DATA" Then StrSQL = "SELECT * FROM QAccessi" & _ " WHERE QAccessi.GIORNO >=#" & Format$(Me.txtdadata, "dd/mm/yyyy") & "# AND QAccessi.GIORNO <= #" & Format$(Me.txtadata, "dd/mm/yyyy") & "# AND QAccessi.GRUPPO " & group & " ORDER BY QAccessi.GIORNO" Dim queryTemp As QueryDef For Each queryTemp In CurrentDb.QueryDefs If queryTemp.Name = "Qtempdata" Then DoCmd.DeleteObject acQuery, "Qtempdata" Exit For End If Next Set queryTemp = CurrentDb.CreateQueryDef("Qtempdata", StrSQL) DoCmd.OpenQuery ("Qtempdata") End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5