data type mismatch

J

johnlute

[numProfilesRevisionsID] is an autonumber field (long integer) with no
format.

The following returns a data type mismatch error:

strWhere = "[numProfilesRevisionsID] = """ & _
Forms![frmRevisions].Form![numProfilesRevisionsID] & """"
DoCmd.OpenReport Me!cbSelectReport, acPreview _
, , strWhere

Does anyone see what the problem is? I suspect I'm improperly
referencing the autonumber...?

Thanks!!!
 
T

Tom van Stiphout

On Thu, 23 Jul 2009 06:45:21 -0700 (PDT), johnlute

You are. Take out the extra double-quotes. That's only appropriate for
text fields.

-Tom.
Microsoft Access MVP
 
J

johnlute

Thanks, Tom. That was it.

On Thu, 23 Jul 2009 06:45:21 -0700 (PDT), johnlute


You are. Take out the extra double-quotes. That's only appropriate for
text fields.

-Tom.
Microsoft Access MVP


[numProfilesRevisionsID] is an autonumber field (long integer) with no
format.
The following returns a data type mismatch error:
strWhere = "[numProfilesRevisionsID] = """ & _
Forms![frmRevisions].Form![numProfilesRevisionsID] & """"
DoCmd.OpenReport Me!cbSelectReport, acPreview _
, , strWhere
Does anyone see what the problem is? I suspect I'm improperly
referencing the autonumber...?
Thanks!!!- Hide quoted text -

- Show quoted text -
 
J

johnlute

Thanks! For the record I just changed to this:
strWhere = "[numProfilesRevisionsID] = " & _
Forms![frmRevisions].Form![numProfilesRevisionsID] & ""

If it's a number then you don't need the brackets. Try this:
 strWhere = "[numProfilesRevisionsID] = " &
Forms![frmRevisions].Form![numProfilesRevisionsID]

--
<a
href="http://www.software-matters.co.uk/bespoke-database-design.html">Bespoke
Access Database Development</a>
<p>Software Matters</br>
Straightforward solutions that work</p>



johnlute said:
[numProfilesRevisionsID] is an autonumber field (long integer) with no
format.
The following returns a data type mismatch error:
strWhere = "[numProfilesRevisionsID] = """ & _
Forms![frmRevisions].Form![numProfilesRevisionsID] & """"
DoCmd.OpenReport Me!cbSelectReport, acPreview _
, , strWhere
Does anyone see what the problem is? I suspect I'm improperly
referencing the autonumber...?
Thanks!!!- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top