473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

subform name on control tab weirdness

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
2 1518
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
2
by: chris vettese | last post by:
I've been having trouble with this for a long time. I have a form that has many subforms. In the subforms I have unbound text boxes in the footer that sum a field. I want to Display this sum on...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
6
by: Mat | last post by:
Dear all, What I want to do is be able to use a string to refer to a control on a subform. IE: Forms!("Form1!form2!controlA").name or
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
1
by: veteranwebdesign | last post by:
Hello, I have a main form. I want forms to open in a subform control box. What is the code for the option group to open the subforms in the control box. I didn't create subforms, I created...
5
by: samdev | last post by:
I have created two combo boxes in a subform.... For example 1. Combo Box State 2. Combo Box City 3. When a state from the Combo Box State is selected, the City combo box updates to reflect...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.