i'm new here.
i have problem with my database.
i asked my friend to key in data.
then, i want to combine all data together in ms access at my computer.
when i run the system the run time error "13" type mismatch appeared.
i don't know what this mean.
i asked my friend but he also don't know what to do.
can anybody tell me what should i do??
i have to get my system ready before this 10th ogos.

Recommended Answers

All 9 Replies

type mismatch. its not match with your type. example: you work with some numeric number. you declare a variable Like

Dim a as string

so it show this msg. type mismatch. cause string value is not match with your work. you need to declare like:

Dim a as Integer

cause integer is for numeric value. same as other. here you not mention what you did. But I think it solve your problem.

did you mean i have to declare every text box that i use to enter data?

not that. you declare it in general declaration. or you use module.

why i have to declare?
the error happen when i paste the data into db
not the data that i added through the system
there is no problem if i added data through system
the system still can run
i just want to combine all data in my db

why i have to declare?

I just give u a example. paste your code.

i have attach my code.
i have another question.
if the text box that i prepared is shorten than the data entered, can it add all the data in the text box?
last month this problem happened.
a message box appeared said that the text box is to small to enter a large data.
but some of the text box do not have the problem even the data is longer than the text box.
at first, i don't know that data is not added.
when i check the db, i can't find the data.
so i edit the text box to be more longer than before.
but that error still occured.
i changed the data type in db from text to memo.
then it can run well.
you think is this the problem why the type mismatch happen?


Where you get error, Can u specify? Then only we can find error easily. That is the line in which the error occured.

Private Sub papar()


maxdata = RS.RecordCount

lblcounter3.Caption = "TOTAL : " & RS.RecordCount & " data"

For i = 1 To maxdata

LV.ListItems.Add , , RS("SERVING_CABINET")
LV.ListItems(i).ListSubItems.Add 1, , RS.Fields("EXCHANGE")
LV.ListItems(i).ListSubItems.Add 2, , RS.Fields("MUKIM")
LV.ListItems(i).ListSubItems.Add 3, , RS.Fields("DAERAH")
LV.ListItems(i).ListSubItems.Add 4, , RS.Fields("ES_WORKING")
LV.ListItems(i).ListSubItems.Add 5, , RS.Fields("ES_FREE")
LV.ListItems(i).ListSubItems.Add 6, , RS.Fields("ADSL_WORKING")
LV.ListItems(i).ListSubItems.Add 7, , RS.Fields("ADSL_FREE")
LV.ListItems(i).ListSubItems.Add 8, , RS.Fields("KAWASAN_PERINDUSTRIAN")
LV.ListItems(i).ListSubItems.Add 9, , RS.Fields("NAMA_SYARIKAT")
LV.ListItems(i).ListSubItems.Add 10, , RS.Fields("ADDRESS")
LV.ListItems(i).ListSubItems.Add 11, , RS.Fields("JENIS_INDUSTRI")
LV.ListItems(i).ListSubItems.Add 12, , RS.Fields("INDUSTRI_SEBUAH")
LV.ListItems(i).ListSubItems.Add 13, , RS.Fields("INDUSTRI_TERES")
LV.ListItems(i).ListSubItems.Add 14, , RS.Fields("KEMBAR")
LV.ListItems(i).ListSubItems.Add 15, , RS.Fields("TELEPHONE")
LV.ListItems(i).ListSubItems.Add 16, , RS.Fields("ADSL")
LV.ListItems(i).ListSubItems.Add 17, , RS.Fields("DATA")
LV.ListItems(i).ListSubItems.Add 18, , RS.Fields("SEGMENT") <<<<<<HERE
LV.ListItems(i).ListSubItems.Add 19, , RS.Fields("KELUASAN")

i try to leave it as comment, it can run.
after a few trials, then the error goes to the next.
the data input include alphabet and number.
example s30, m20.
the data type that i choose in ms access is text.
can i use text if alphabet and number is the input?

my problem solved!
i change the data type and also the data in db
now i can run my program

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.