Countymnca
Technical User
Hello,
A request has come in to modify an existing and working function that generates a report based on one text field on the form. Occasionally, there are 2 or more records that have the same text value [CustNumber]in this field, so multiple reports are created. I have been attempting to add another field [InvNumber] to the existing stLinkCriteria so that only one report will be generated. InvNumber is also text, but I am getting a Data mismatch error when I attempt to run it. What am I missing or can this not be done via this method?
stLinkCriteria = "[CustNumber]=" & "'" & Me![CustNumber] & "'" And "[InvNumber]=" & "'" & Me![InvNumber] & "'"
Both criteria work when seperate, so I know it is something to do with joining them together that I am missing.
All fields are text fields despite their names and are not combo boxes on the form.
A request has come in to modify an existing and working function that generates a report based on one text field on the form. Occasionally, there are 2 or more records that have the same text value [CustNumber]in this field, so multiple reports are created. I have been attempting to add another field [InvNumber] to the existing stLinkCriteria so that only one report will be generated. InvNumber is also text, but I am getting a Data mismatch error when I attempt to run it. What am I missing or can this not be done via this method?
stLinkCriteria = "[CustNumber]=" & "'" & Me![CustNumber] & "'" And "[InvNumber]=" & "'" & Me![InvNumber] & "'"
Both criteria work when seperate, so I know it is something to do with joining them together that I am missing.
All fields are text fields despite their names and are not combo boxes on the form.