If both fields are Long Integer types, the structure should be fine.
Are you certain that the recordset has a current record (e.g. it may not
after a failed FindFirst or if there are no records), and that the fields
are not Null or Error?
Brackets may help Access understand what you intend:
strWhere = "([HIST_JRNENTRY] = " & rsSBMPRDists!JRNENTRY & ") AND
([HIST_ACTINDX] = " & rsSBMPRDists!ACTINDX & ")"
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Tom Glasser" <(E-Mail Removed)> wrote in message
news:B755F943-57C5-4BC1-BC19-(E-Mail Removed)...
>
> I'm constructing a search string and then using the 'Find' method for a
recordset.
> I want to check two fields and so I'm using an "AND" construct. But I
keep getiing
> the following error:
>
> "Arguments are of the wrong type, are out of range, or are in conflict
with one another."
>
> If I test using each field separately, I get no error. See examples
below:
>
> strWhere = "[HIST_JRNRNTRY] = " & rsSBMPRDists!JRNENTRY (OK)
>
> strWhere = "[HIST_ACTINDX] = " & rsSBMPRDists!ACTINDX (OK)
>
> strWhere = "[HIST_JRNENTRY] = " & rsSBMPRDists!JRNENTRY & " AND
[HIST_ACTINDX] = " & rsSBMPRDists!ACTINDX (Error)
>
> The fields involved are defined as Long Integer. Is there something wrong
with the syntax of the third
> line that uses AND ?
>
> Flustered,
> Tom