Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Data Control

Status
Not open for further replies.

Fabiana

Programmer
Mar 5, 2000
4
0
0
AR
<br>
<br>
I have a problem. Can anybody help me?. <br>
I have a form with two data control and a dbgrid linked to each data. When I <br>
delete a record of the recordset and I do 'Refresh' of one of the data the <br>
program fails and shows a window saying &quot;The program has made an invalid <br>
operation&quot;. <br>
This happens when I execute the exe file, but don't when I execute the aplication <br>
pressing F5 inside Visual Basic's environment. <br>
Thank you for your time. <br>

 
Thats difficult to troubleshoot with such a vague Error<br>
Is there an Error number with the message.<br>
Try adding a ON_Error trap in every sub or function<br>
here is a snippet I use. Of course you must change the XXX to match your stuff.<br>
-----------------------<br>
On Error GoTo Err_xxxxx '&lt; This goes at the top below the Private SUB ...<br>
<br>
<br>
Exit_xxxxx: &lt;' all of this code goes at the bottom before the &quot;END SUB&quot;<br>
Exit Function<br>
<br>
Err_xxxxx:<br>
Select Case Err.Number<br>
Case 3021<br>
' No current record<br>
' Note this 3021 can be something else for your situation.<br>
Case Else<br>
MsgBox &quot;Error # &quot; & Err.Number & &quot; &quot; &Err.Description, vbInformation, &quot;In sub xxxxxxx&quot;<br>
Resume Exit_xxxxxx<br>
End Select<br>
---------------------<br>
<br>
Now make sure you put somehing meanful in the &quot;xxxx&quot; for this line &quot;In sub xxxxxxx&quot; <br>
This MAY shed some light on where the error is coming from.<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Just a thought - instead of adding error handlers everywhere it might be easier to set &quot;break on all errors&quot; in Options.<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top