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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 <--
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top