|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Runtime Error 5 - Invalid Procedure call or Argument |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|