Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 3rd, 2005, 06:28 PM
kazimmalik kazimmalik is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 kazimmalik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 44 sec
Reputation Power: 0
Exclamation Runtime Error 5 - Invalid Procedure call or Argument

Hi I am having this error b/w MsgBox step 2 & MsgBox step 3 . Step 2 is displyed and then i am greeted with this error. If i run my program through the VB

the problem doesn't occur but after making exe file if i run it this problem occurs every time. I am using VB 6.0 on windows 2000.kindly advise.......

'############# find a well ################
Case cmdFind
Dim iReturn As Integer
gFindString = ""
With frmFind
.Caption = "Type Well Number to find"
' .recordSource = "SELECT API_Number FROM Wellbore_Data "
.Show vbModal
End With

iMsg = MsgBox("Step4 ", vbCritical, "Well Number")
If (Len(gFindString) > 0) Then
' Data1.UpdateControls
With Data1.Recordset
iMsg = MsgBox("Step5 ", vbCritical, "Well Number")
.FindFirst "API_Number = '" & gFindString & "'"
If (.NoMatch) Then
iReturn = MsgBox("Well Number " & gFindString & " was not found.", vbCritical, "Well Number")
Else
iReturn = MsgBox("Well Number " & gFindString & " was retrieved.", vbInformation, "Well Number")
txtAPI_Number.Text = gFindString
End If
End With
End If
updateButtons

Case cmdDone
Unload Me
End Select
End Sub
'########################### In the form find i have written this code

Private Sub Form_Activate() ' pg 249
List1.Enabled = False
dtaFind.DatabaseName = App.Path & "\ColumbiaGas.mdb"
dtaFind.RecordSource = "SELECT API_Number FROM Wellbore_Data ORDER BY [Well]"
dtaFind.Refresh
If (dtaFind.Recordset.RecordCount > 0) Then
Screen.MousePointer = vbHourglass
dtaFind.Recordset.MoveFirst
While Not dtaFind.Recordset.EOF
List1.AddItem dtaFind.Recordset.Fields(0) & ""
dtaFind.Recordset.MoveNext
Wend
List1.Enabled = True
DoEvents
End If
lblCount = "There are " & dtaFind.Recordset.RecordCount & " Wells"
Screen.MousePointer = vbDefault

End Sub

Private Sub txtFind_Change() 'pg 252
Dim entryNum As Long
Dim txtToFind As String
txtToFind = txtFind.Text
entryNum = sendMessageByString(List1.hwnd, LB_SELECTSTRING, 0, txtToFind)
End Sub
Private Sub List1_DblClick() 'pg 253
' get the item the user clicks and asssign it
iMsg = MsgBox("Step1 ", vbCritical, "Well Number")
gFindString = List1
iMsg = MsgBox("Step2 ", vbCritical, "Well Number") ' ????????????????????????????????????????????
dtaFind.Recordset.Close
frmFind.Hide
Exit Sub
'Unload Me
iMsg = MsgBox("Step3 ", vbCritical, "Well Number")
End Sub
Private Sub cmdCancel_Click() ' pg 254
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Set frmFind = Nothing
Unload Me
End Sub

' #######################I have defined following things in Global module

Public Declare Function sendMessageByString& Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As String) ' pg 239
Public Const LB_SELECTSTRING = &H18C
Public gFindString As String
Public iMsg As Integer

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Runtime Error 5 - Invalid Procedure call or Argument


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway