By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,663 Members | 1,827 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,663 IT Pros & Developers. It's quick & easy.

Why does tracing (debug) yield different results?

P: n/a
Hi. I have a form with a label (lblNavigate). The text (caption) is
supposed to state, either, "New Record" or "xxx of yyy" (where xxx =
current record number and yyy = total number of records). I set
me!lblNavigate.caption in the Form_Current( ) routine. If I don't trace
the routine, the text shows ("1 of 1"). There are, actually, 2 records
in the recordset. If I trace the routine (debug mode) the text gets
populated properly and it displays "1 of 2".

Why is this happening? How can I get the text to display the way I want
it to?

Thanks.
SueB

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This is a timing issue.

In the first moment that the form loads, it loads just the first record. The
others are loaded when it gets a spare moment. When you trace through the
code, there has been a spare moment, and so the count is different.

If you are using code to get the number of records, you could force all
records to load like this:
Me.RecordsetClone.MoveLast
Debug.Print Me.RecordsetClone.RecordCount & " record(s)"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Susan Bricker" <sl*****@verizon.net> wrote in message
news:N3**************@news.uswest.net...
Hi. I have a form with a label (lblNavigate). The text (caption) is
supposed to state, either, "New Record" or "xxx of yyy" (where xxx =
current record number and yyy = total number of records). I set
me!lblNavigate.caption in the Form_Current( ) routine. If I don't trace
the routine, the text shows ("1 of 1"). There are, actually, 2 records
in the recordset. If I trace the routine (debug mode) the text gets
populated properly and it displays "1 of 2".

Why is this happening? How can I get the text to display the way I want
it to?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.