Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2003 Type Mismatch Error

Posted on 2012-03-27
7
Medium Priority
?
384 Views
Last Modified: 2012-08-08
Can anyone tell me why I get this error, "The expression On Current you entered as the event property setting produced the following error: Type mismatch."  I get the error when the program is opened on a computer with only the Access 2003 runtime installed.  On computers with full version Access all works as expected.

This is the code I have in the On Current event.

If Me.txtD36 <= 3 Or Me.txtD36 >= 87 Then
    Me.txtD36.BackColor = 65280
    Me.txtD36.ForeColor = 0
Else
    Me.txtD36.BackColor = 2366701
    Me.txtD36.ForeColor = 16777215
End If

Any help appreciated.

Gary
0
Comment
Question by:garymcgowan
  • 4
  • 3
7 Comments
 
LVL 35

Accepted Solution

by:
Norie earned 2000 total points
ID: 37772118
Is txtD36 a text field?

If it is try this.
If Val(Me.txtD36) <= 3 Or (Me.txtD36) >= 87 Then

Open in new window

0
 

Author Comment

by:garymcgowan
ID: 37773233
Its an unbound field

Format: Fixed
Decimal Places: 0

I tried your suggestion anyway but it didn't fix the problem.  Any other ideas?

Thanks,

Gary
0
 
LVL 35

Expert Comment

by:Norie
ID: 37773318
Gary

Does it have a value when this code runs?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:garymcgowan
ID: 37773442
Yes, a number.  It works fine in the full version of access but not the runtime.

Gary
0
 
LVL 35

Expert Comment

by:Norie
ID: 37773475
Gary

Is that all the code?

Is there no Sub/End Sub?
0
 

Author Comment

by:garymcgowan
ID: 37773588
Private Sub Form_Current()

If Me.txtD36 <= 3 Or Me.txtD36 >= 87 Then
    Me.txtD36.BackColor = 65280
    Me.txtD36.ForeColor = 0
Else
    Me.txtD36.BackColor = 2366701
    Me.txtD36.ForeColor = 16777215
End If



End Sub
0
 

Author Closing Comment

by:garymcgowan
ID: 38272775
The answer by imnorie did not work for me but I am giving him the points for at least trying to solve my problem.

Gary
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question