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

subform name on control tab weirdness

P: n/a
I have a stupid question (so finish swallowing now... I don't want to
be accused of any beverage-related mishaps).

I have a form with several subforms, with each subform on a separate
tab. I'm trying to loop through the subforms so that I can set the
caption of the tabcontrol page to something like <SubName>
(recordcount)

Okay, now the two dumb questions...
1. why do these subforms think they're called "tbl..." when I saved the
subforms with a "sfrm" prefix?

for a sanity check, I looped through the form's controls and got some
weird results - the forms were'nt always named "sfrm...", some were
"tbl..."

Dim ctl As Control
For Each ctl In Me.Controls
'If Left$(ctl.Name, 4) = "sfrm" Then
' Debug.Print ctl.Name
'End If
If TypeOf ctl Is SubForm Then
Debug.Print ctl.Name
End If
Next ctl

okay, second dumb question - to eliminate the mad blinking caused by
the OnCurrent event of the mainform requerying the subforms... should I
use just the subform's RecordCount property?

I have Keri's article from AccessWeb (examples of syntax for referring
to various objects) - I'm just trying (in vain) to figure out how to do
this right

Do you use .RecordsetClone.Recordcount in this instance?

Thanks!
Pieter

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
pi********@hotmail.com wrote:

<SNIP>

I have Keri's article from AccessWeb (examples of syntax for referring
to various objects) - I'm just trying (in vain) to figure out how to do
this right

Do you use .RecordsetClone.Recordcount in this instance?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Using DAO:
You can use .Recordset.Recordcount, but, because the Recordcount
sometimes isn't correct until you've hit the last "record" I usually use
the RecordsetClone - i.e.,

Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
Debug.Print rs.RecordCount

If I did that w/ the .Recordset the form would show the movement &
confuse the user.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQuVF84echKqOuFEgEQKatQCfd/fgDXsr9rvbhJKwTrDiS8U/f0EAoKrL
2OLLlOG0wJoOicK/IpBMvGQW
=baQM
-----END PGP SIGNATURE-----
Nov 13 '05 #2

P: n/a
oh, I am sooo S-M-R-T! How about

Application.Echo False
'do all the recalculating
Application.Echo True

SOmetimes you have to reintroduce yourself to the Help file... I'm so
bright it hurts my eyes.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.