Gemme SQL-streng som ny forespørgsel
Hvordan gemmer jeg følgende SQL-streng, som en ny forespørgsel, eller ny tabel ?Dim SQL As String
SQL = SQL & \"WHERE \"
If Not IsNull([Forms]![Frm_Choice].[Form]![Cmb_Employee]) Then
SQL = SQL & \"EmployeeID like \'*\" & [Forms]![Frm_Choice].[Form]![Cmb_Employee] & \"*\' AND \"
End If
If Not IsNull([Forms]![Frm_Choice].[Form]![Cmb_Customer]) Then
SQL = SQL & \"CustomerID like \'*\" & [Forms]![Frm_Choice].[Form]![Cmb_Customer] & \"*\' AND \"
End If
If Not IsNull([Forms]![Frm_Choice].[Form]![Cmb_Status]) Then
SQL = SQL & \"PriorityID like \'*\" & [Forms]![Frm_Choice].[Form]![Cmb_Status] & \"*\' AND \"
End If
If Not IsNull([Forms]![Frm_Choice].[Form]![Cmb_Project]) Then
SQL = SQL & \"ProjectID like \'*\" & [Forms]![Frm_Choice].[Form]![Cmb_Project] & \"*\' AND \"
End If
End If