Code line only works iwth a break point added to it?! - Very Stran

Z

Zilla

Hi,

This is really odd, the following sub runs fine in every respect except for
one line within it, which wasn't working (did'nt perform the action). I
added a break point at that line and voila - it works. The line however stops
working as soon as I remove the break again!!

***
Private Sub Form_Open(Cancel As Integer)

If Me.OpenArgs = "all" Then Me.ComService.RowSource = "SELECT Service_ID,
Service_Name, Lead_Agency, District FROM qryServices ORDER BY Service_Name"

Me.TxtDist = Me.OpenArgs
Me.chkNamedUser = -1


Me.ComService.Enabled = True
Me.ComUser.Enabled = True
Me.Combo347.Enabled = False
Me.Form_Date.Enabled = True


End Sub

***

The problem line is: " Me.chkNamedUser = -1 "

Anyone seen anything like this before? Thanks
 
S

Stefan Hoffmann

hi,
This is really odd, the following sub runs fine in every respect except for
one line within it, which wasn't working (did'nt perform the action). I
added a break point at that line and voila - it works. The line however stops
working as soon as I remove the break again!!
Try a DECOMPILE.
Me.chkNamedUser = -1
Don't rely on the default property, use the .Value property explicitly.


mfG
--> stefan <--
 
D

Douglas J. Steele

Try putting the code in the form's Load event. Not all of the controls are
going to be properly instantiated in the Load event.
 
Top