Run-Time Error 3464 Data Type Mismatch

tdefreest

Registered User.
Local time
Today, 12:04
Joined
Dec 16, 2015
Messages
23
Hello,

I am trying to open a form based on a records PrimaryID number, in this case it is called ProposalNumberID. The VBA code I'm using to do this is:

Code:
 Private Sub 
 Proposal_Number_Click()   
  DoCmd.OpenForm "frmPROPOSALINFORMATIONInputForm", , , "[ProposalNumberID] = '" & Me.[ProposalNumberID] & "'"
 End Sub

The error I'm receiving is "run-time error '3464' data type mismatch criteria expression" and is occurring on the whole line.

Some background info on the issue:
I originally had the variable as "[ProposalNumber]" but I just recently changed my Primary Key from ProposalNumber (Indexed, no duplicate field) to ProposalNumberID (an autonumber). I have fixed all relationships and I have added the PrimaryID field to the report and form and made it non-visible. So everything should be working, but I may have missed something.. because its not working..

I'm at a loss of how to proceeded so any help would be greatly appreciated.
 
IDs are numeric, so remove the quotes,

doCmd.OpenForm "frmPROPOSALINFORMATIONInputForm", , , "[ProposalNumberID] = " & Me.[ProposalNumberID]
 
IDs are numeric, so remove the quotes,

doCmd.OpenForm "frmPROPOSALINFORMATIONInputForm", , , "[ProposalNumberID] = " & Me.[ProposalNumberID]

Thank you!! That solved the issue.:D:D
 

Users who are viewing this thread

Back
Top Bottom