M
Mike Revis
Hi Group,
Access 2007. Win xppro
I cannot figure out how to add a second where clause.
I have this to loop through the recordset returned by JobNumber. There can
be multiple package records within the JobNumber recordset.
This is the part of the code in the page footer format section of the report
that I am trying to alter.
strSQL = "SELECT DISTINCT tblPartData.NAERG, tblPartData.UNorIDNumber " & _
"FROM tblPartData " & _
"WHERE [JobNumber]= '" & Forms!frmpackage![JobNumber] & "'"
JobNumber is text data type.
It shows on the report as UNorIDNumber = NAERG. UN1234 = 123
The query that the report is based on is set to exclude records where the
field IsDG = false.
IsDG is a yes/no data type.
This code above does not exclude those records. So I am getting an = without
the data.
If I have 2 records and one has IsDG = false I get = UN1234 = 123
I have tried various iterations of *AND WHERE
Forms!frmpackage!sfrmPart.Form!IsDG = True* with little success.
The fields UnorIDNumber, NAERG and IsDG are all on the subform sfrmPart and
in the table tblPartData.
The closest I have come is "data type mismatch"
I suspect it has something to do with those pesky little &"&' " " 's which I
could never get the hang of.
As always any thoughts, comments or suggestions are welcome.
Best regards,
Mike
Access 2007. Win xppro
I cannot figure out how to add a second where clause.
I have this to loop through the recordset returned by JobNumber. There can
be multiple package records within the JobNumber recordset.
This is the part of the code in the page footer format section of the report
that I am trying to alter.
strSQL = "SELECT DISTINCT tblPartData.NAERG, tblPartData.UNorIDNumber " & _
"FROM tblPartData " & _
"WHERE [JobNumber]= '" & Forms!frmpackage![JobNumber] & "'"
JobNumber is text data type.
It shows on the report as UNorIDNumber = NAERG. UN1234 = 123
The query that the report is based on is set to exclude records where the
field IsDG = false.
IsDG is a yes/no data type.
This code above does not exclude those records. So I am getting an = without
the data.
If I have 2 records and one has IsDG = false I get = UN1234 = 123
I have tried various iterations of *AND WHERE
Forms!frmpackage!sfrmPart.Form!IsDG = True* with little success.
The fields UnorIDNumber, NAERG and IsDG are all on the subform sfrmPart and
in the table tblPartData.
The closest I have come is "data type mismatch"
I suspect it has something to do with those pesky little &"&' " " 's which I
could never get the hang of.
As always any thoughts, comments or suggestions are welcome.
Best regards,
Mike