Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2003 Type Mismatch Error

Posted on 2012-03-27
7
Medium Priority
?
382 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 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 34

Expert Comment

by:Norie
ID: 37773318
Gary

Does it have a value when this code runs?
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

688 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