Link to home
Start Free TrialLog in
Avatar of dosyl
dosyl

asked on

Run time error 13 Type Incompatible

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?
Avatar of vikiing
vikiing

Error 13 speaks about certain incompatibility with data types.

Please, tell us the EXACT instruction/function that gives you that error.
what platform are you trying to run it on and what kind of program is it?
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>.
Avatar of Guy Hengel [angelIII / a3]
Also describe your installation routine
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.
Avatar of dosyl

ASKER

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.
does it produce an error immediately upon opening the form?
Avatar of dosyl

ASKER

AzraSound , yes the form appear and disappear immediatly.
ok can you give us the code on the form load event for that form
Avatar of dosyl

ASKER

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
Avatar of dosyl

ASKER

GrilleFact is VsFlexGrid
Avatar of dosyl

ASKER

Another thihg for this form, i use Load FrmFacture instead of FrmFacture.Show 1.
Try Me.Refresh or GrilleFact.Refresh or before calling it properties
Cheers
Another one:
where this array initialize - Facture(1)?
Avatar of dosyl

ASKER

Facture() is initialized in RechFichAt.
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!
Avatar of dosyl

ASKER

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

Avatar of dosyl

ASKER

Thank's vikiing.