Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Geting a type mismatch error on code to open form

Using this code I'm getting a type mismatch error.

DoCmd.OpenForm "frmSurveys", acNormal, , "[1RatePerformance]=" & Me.txtCount21 And "[BuyersAgent]=" & Forms!frmSearchForIndividualAgentSurvey.txtAgentID, acFormReadOnly, acWindowNormal

Note that both 1RatePerformance and BuyersAgent are number fields.

????
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SteveL13

ASKER

It is numeric but it opens a blank form.
try

DoCmd.OpenForm "frmSurveys", acNormal, , "[1RatePerformance]=" & Me.txtCount21 & " And [BuyersAgent]=" & Forms!frmSearchForIndividualAgentSurvey.txtAgentID, acFormReadOnly, acWindowNormal


if [BuyersAgent] is TEXT

DoCmd.OpenForm "frmSurveys", acNormal, , "[1RatePerformance]=" & Me.txtCount21 & " And [BuyersAgent]='" & Forms!frmSearchForIndividualAgentSurvey.txtAgentID & "'", acFormReadOnly, acWindowNormal
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Listen to Dale. You have asked this type of questions so many times, and it will save you a lot of time in the future.

/gustav
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial