Solved

Run time error 13 Type Incompatible

Posted on 2000-04-01
20
378 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 143

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
 
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 28

Expert Comment

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

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 28

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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