Hi,
i have a problem. i made a .exe file of my project. when i search an Existing record its working fine. but when i enter a worng entery in search field the error Occurred "Run-time error 5 invalid procedure call or argument"
but when i do all these exercise in vb 6 software it working fine no error Occurre.
please help me in this regard as soon as Possible.
Software/Hardware used:
ASKED:
September 12, 2006 3:24 PM
UPDATED:
September 14, 2006 6:06 AM
i did but i have the same problem. kindly look into this.
thankx.
If it’s very repeatable, that’s when I start sprinkling msgboxes around. Start putting in msgboxes starting at the beginning of the event that fires after whatever you are doing. then start working your way down until you don’t get a message box and narrow it down to that line. If you already know the line, look carefully at the parameters and see what possibilities there are for an invalid argument.
The problem goes something like this: you are calling a procedure with a parameter that is bad or cannot be converted to the correct type (int, date, etc).
VB will convert the type for you in most cases, however when it cannot convert the data, it will generate a runtime error.
if your function takes a number and you are passing a string that can be converted to a number it works fine however if Myfunction below takes a number and you pass something like this it generates a runtime error.
function myFunction(a_Value as int)
call MyFunction(“12345″ ) ‘ this works
Call Myfunction(“a2345″) ‘ this generates a runtime error
The solution is to create an error trap and catch the error or perform validation on the parameter before you call the function call. For example:
if isNumeric(myInput) then
call MyFunction(myinput)
else
‘error message, etc
end if
Sounds like there is a function used in the progran, which gets it’s arameters in a wrong way like
- wrong data type
- some value missing (null)
Try to run your program in VB6 development window, so you will be able to debug your program.
Kaj Bredenberg