Solved

Access 2003 Type Mismatch Error

Posted on 2012-03-27
7
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 34

Accepted Solution

by:
Norie earned 500 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 34

Expert Comment

by:Norie
ID: 37773318
Gary

Does it have a value when this code runs?
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 

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 34

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
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…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Suggested Courses

632 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