Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

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?
0
dosyl
Asked:
dosyl
  • 8
  • 3
  • 3
  • +4
1 Solution
 
vikiingCommented:
Error 13 speaks about certain incompatibility with data types.

Please, tell us the EXACT instruction/function that gives you that error.
0
 
AzraSoundCommented:
what platform are you trying to run it on and what kind of program is it?
0
 
wsh2Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Also describe your installation routine
0
 
wsh2Commented:
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
 
dosylAuthor Commented:
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
 
AzraSoundCommented:
does it produce an error immediately upon opening the form?
0
 
dosylAuthor Commented:
AzraSound , yes the form appear and disappear immediatly.
0
 
AzraSoundCommented:
ok can you give us the code on the form load event for that form
0
 
dosylAuthor Commented:
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
 
dosylAuthor Commented:
GrilleFact is VsFlexGrid
0
 
dosylAuthor Commented:
Another thihg for this form, i use Load FrmFacture instead of FrmFacture.Show 1.
0
 
ArkCommented:
Try Me.Refresh or GrilleFact.Refresh or before calling it properties
Cheers
0
 
ArkCommented:
Another one:
where this array initialize - Facture(1)?
0
 
dosylAuthor Commented:
Facture() is initialized in RechFichAt.
0
 
ArkCommented:
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
 
gcs001Commented:
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
 
dosylAuthor Commented:
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
 
vikiingCommented:
>>>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
 
dosylAuthor Commented:
Thank's vikiing.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 3
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now