Solved

Run time error 13 Type Incompatible

Posted on 2000-04-01
20
369 Views
Last Modified: 2010-05-02
My pgm. works fine. Why when i install it on another computer i have this message only for one form on 15 forms.

What can i do to check where is the error, because i have the error on the user's computer?
0
Comment
Question by:dosyl
  • 8
  • 3
  • 3
  • +4
20 Comments
 
LVL 3

Expert Comment

by:vikiing
ID: 2676561
Error 13 speaks about certain incompatibility with data types.

Please, tell us the EXACT instruction/function that gives you that error.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2676570
what platform are you trying to run it on and what kind of program is it?
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2676585
Sounds a little like an out of date, or superceded DLL version (or OCX) is being used.. on either of the machines. Platform.. and what is different in that form compared to the others.. is going to be the key.. <smile>.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2676588
Also describe your installation routine
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2676589
Hmmmm... I'm also wondering what compile options he/she turned off when the project was made. An array overflow could cause this too.. ergo.. a logic problem.
0
 
LVL 1

Author Comment

by:dosyl
ID: 2676602
I cannot tell where is the problem, i never had the problem on my computer, i have it only on the user's computer. I have Windows98 on my computer and W95 on the user's computer.

The difference in this form i user TabStrip and never in the other forms.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2676611
does it produce an error immediately upon opening the form?
0
 
LVL 1

Author Comment

by:dosyl
ID: 2676612
AzraSound , yes the form appear and disappear immediatly.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2676629
ok can you give us the code on the form load event for that form
0
 
LVL 1

Author Comment

by:dosyl
ID: 2676639
Here is the Form_Load

Private Sub Form_Load()
'***************
'On redimensionne la feuille d'après l'écran utilisé.
Resizer1.Rebuild 'ActiveX to resize the form(i use it in the others forms too)
Resizer1.Refresh
'***************
Dim Tmp As Integer
Dim NumFacture As String
Set rstRecev = dbCli.OpenRecordset("Recevab", dbOpenDynaset) 'rstRecev sert dans la procédure Imprime.
Set rstInv = dbCli.OpenRecordset("Invent", dbOpenDynaset) 'rstInv sert dans la procédure RemplNo.
Set rstMatImm = dbCli.OpenRecordset("MatImm", dbOpenDynaset) 'rstMatImm sert dans la procédure MatTr.
Set rstFactImm = dbCli.OpenRecordset("FactImm", dbOpenDynaset) 'rstMatImm sert dans la procédure mnuFactRec.

 Me.Visible = True

'Je commence par ouvrir la dernière Facture en Attente pour l'impression.
RechFichAt


 'S'il a y rien dans Facture(1), c'est qu'il n'y a pas de Facture en Attente.
If Facture(1) = "" Then mnuFactNouv_Click

GrilleFact.Editable = True
GrilleFact.ColComboList(0) = "..."

TxtFact(12).Text = Format(Date, "ddddd")
End Sub
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:dosyl
ID: 2676644
GrilleFact is VsFlexGrid
0
 
LVL 1

Author Comment

by:dosyl
ID: 2676714
Another thihg for this form, i use Load FrmFacture instead of FrmFacture.Show 1.
0
 
LVL 27

Expert Comment

by:Ark
ID: 2676878
Try Me.Refresh or GrilleFact.Refresh or before calling it properties
Cheers
0
 
LVL 27

Expert Comment

by:Ark
ID: 2676881
Another one:
where this array initialize - Facture(1)?
0
 
LVL 1

Author Comment

by:dosyl
ID: 2676910
Facture() is initialized in RechFichAt.
0
 
LVL 27

Accepted Solution

by:
Ark earned 50 total points
ID: 2676934
If you can look your form before error, your error is somewhere after me.visible statement. There are only 5 strings of code. Possible reasons:
1. Error may be at RechFichAt
2. Array Facture() must be Public and declaring as string. Facture(1) must exist and not be Nothing (Nothing not equal "") - so you need to initialize Facture(1) at RechFichAt. (ie. Facture (1) = "" and then change)
3. IFAIK in old VB versions (4 and below) some controls initialized AFTER Form_Load event, so you can not call them from Form_Load. But in this case you'll receive Object require Error. Anyway, try to initialize Flexgrid using Refresh method or call its properties from another event using flag
4. Check FlexGrid osx versions on both machines.
Cheers


 
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2677249
To figure out exactly where the error is ocurring:
Put in some message boxes or write away to a file and keep an audit trail of exaclt which step is to come or has just completed in the form load event.

Currently everyone is grasping at straws - find the exact line causing the error first!
0
 
LVL 1

Author Comment

by:dosyl
ID: 2680485
I accept Ark's answer, but gcs001 have the good idea to find the error.
The error was after RechFichAt, in this sub i call another sub Cadre1Calcul and i make a Calcul; here is the problem:
Dim X As Integer
Dim Total As Currency
Total = 0
GrilleFact.Row = 0
GrilleFact.Col = 3
For X = 1 To GrilleFact.Rows - 1
    GrilleFact.Row = GrilleFact.Row + 1
    Total = Total + CCur(GrilleFact.Text)
Next X

I can't convert GrilleFact.Text in Currency directly; i must to write this:
    Total = Total + CCur(val(GrilleFact.Text)). And it works, but i don't know if it is the best way to convert a String in Currency.

To find the error i put MsgBox anywhere, but i don't understand why in VB the convert is done automatically?

gcs001 i give points to you too look for the question for you.
0
 
LVL 3

Expert Comment

by:vikiing
ID: 2683521
>>>why in VB the convert is done automatically?

VB converts almost everything (what you want and what you don't want)automatically.

The most convenient is what you've done: always use VAL() function.

0
 
LVL 1

Author Comment

by:dosyl
ID: 2683736
Thank's vikiing.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now