473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Data mismatch error...please help!

1
[PHP]lstSearchDoctor.ItemData(lstSearchDoctor.NewIndex) = mrsDoctorList!DoctorCode[/PHP]

Where DoctorCode as String

[PHP]lstSearchPatient.ItemData(lstSearchPatient.NewInde x) = mrsPatientList!PatientNum[/PHP]

Where PatientNum As Integer

Runtime error (13) data mismatch

Please help
Apr 12 '07 #1
1 1611
[PHP]lstSearchDoctor.ItemData(lstSearchDoctor.NewIndex) = mrsDoctorList!DoctorCode[/PHP]

Where DoctorCode as String

[PHP]lstSearchPatient.ItemData(lstSearchPatient.NewInde x) = mrsPatientList!PatientNum[/PHP]

Where PatientNum As Integer

Runtime error (13) data mismatch

Please help
Hello,
You will get the runtime error. type mismatch.
I explain U in Details

Look .itemdata(index as integer) can only hold the Integer value as well as decimal value. i.e is the value should be numeric
like
Expand|Select|Wrap|Line Numbers
  1.   Combo1.AddItem "saikat"  'OK
  2.   Combo1.ItemData(Combo1.NewIndex) = 23 ' OK
  3.   Combo1.AddItem "kaushik"
  4.   Combo1.ItemData(Combo1.NewIndex) = 14'Ok
  5.  
Now when you use numeric value in string like "123" or "123.12" it will convert it
in integer
like 123 ,123 respectively
Expand|Select|Wrap|Line Numbers
  1.   Combo1.AddItem "saikat"
  2.   Combo1.ItemData(Combo1.NewIndex) = "23.23" 'no error 
  3.  
  4.   Combo1.AddItem "kaushik"
  5.   Combo1.ItemData(Combo1.NewIndex) = 14 'no error 
  6. ' the code works fine
  7.  
Now come to the main point when you try to assign alphanumeric value like "C123" in .itemdata then it will give you the runtime error.
Expand|Select|Wrap|Line Numbers
  1.   Combo1.AddItem "saikat"
  2.   Combo1.ItemData(Combo1.NewIndex) = "abc23" ' Error occur
  3.   Combo1.AddItem "kaushik"
  4.   Combo1.ItemData(Combo1.NewIndex) = 14 'no error
  5.  
So the conclusation is you can't store alpha-numeric value in itemdata.
I think u mention that the doctor code is string so it may contain code like"D123" Plz check it.
If u want to store the doctor code then use additems property to store it.
Hope I am cleared your confusion. good luck.
Apr 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Laura | last post by:
Help. Below is my code. Getting Type mismatch error on the noted line. I'm trying to send an array (aryNewD) with 4 columns and x rows to a function to save all the array info into a SQL Server...
3
by: Martin Lacoste | last post by:
Is there some issue with using too many left/right/mid/len functions in queries? Depending on the usage, they work fine, but... then there's here: SELECT Master_CAO.Incipit,...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
3
by: martlaco1 | last post by:
Trying to fix a query that (I thought) had worked once upon a time, and I keep getting a Data Type Mismatch error whenever I enter any criteria for an expression using a Mid function. Without the...
2
by: Rehan | last post by:
Hi there! Please help me out here. I am an inch away from completing my assignment. I am very new to VBA but i have very less time to be efficient at it. I am getting a type mismatch error...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
5
by: blackburnj55 | last post by:
Hi, I am constructing a website for a bike shop. I am using dreamweaver and an access database to create it. I have made a query where two criteria are entered to get results. These are :...
2
by: irkahs | last post by:
Dear friends, I am connecting an ASP page to an Access table. The table in Access has a field called orderNo which is of type "Number". Now...what I want to do is design an SQL...
3
by: Bruce Lawrence | last post by:
I've got a form that when it opens it prompts the user for 2 peices of information. The Asset and the Date. getasset = InputBox("Enter the Asset Number") If getasset = "" Then Exit Sub Else...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.