General Query

  • Thread starter Thread starter Hann
  • Start date Start date
H

Hann

Guest
My DB shall eventually be able to display single informations regarding Mobile telephones selected by models, colours or mobile description.
Ive got a table containing all this information, yet on the queries I would proceed in writing a query for each thinkable combination of models, colours, descriptions and maybe even qty-limitations.

Is there a possibility to write a general query from which the forms or reports can finally take all this distinct info?
 
I used a different method and wonder if it is as good as yours:
I created the form and on closing, it opens the report with the criteria build in the form.
Code:
    Dim NomDuRapport As String
    Dim Critere As String
    
    NomDuRapport= "EInterrupteurTelecom"
    If IsNull(txtDateDebut) And IsNull(txtDateFin) And IsNull(txtQuelleAnnee) Then
        Critere = ""
    Else
        If txtDateDebut.Enabled = True Then
            Critere = "[DateCiblee] >= #" & Me!txtDateDebut & "# and [DateCiblee] <= #" & Me!txtDateFin & "#"
        Else
            Critere = "Year([DateCiblee]) = " & Me!txtQuelleAnnee
        End If
    End If
    DoCmd.OpenReport NomDuRapport, acPreview, , Critere
 
That should work, too. An advantage of the way I mentioned, though, is you can reference the form from the report to be able to display the criteria values, or anything else you may want to dynamically add to the report.
 

Users who are viewing this thread

Back
Top Bottom