Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Loop Through Absolutely All Open Forms /Subforms /Tabs / Controls

Hi, I know I am posting a lot of questions, feel free to ignore them if they become irritating. Here is one more problem. In a previous post, I posted a code that I had worked out which allowed me to reset the Recordsource of certain combo boxes based on their names in all forms and subforms that were open. At least that's what I thought it would do. In fact it only goes one level deep, so that if your subform has a subform (or the dreaded tab collection) then it won't touch those. Once again VBA has thrown me for a loop, quite literally. I am sure it is an easy task but I can't figure it out. How would I loop through absolutely all open forms/subforms/sub sub forms/ tabs in subforms etc. ? I need to go n+ levels down. I post my original code so you can see my thinking.


Dim frm As Form, intI As Integer
Dim intJ As Integer
Dim intK As Integer
Dim intControls As Integer, intForms As Integer
Dim intsubControls As Integer
Dim subfrm As Form
intForms = Forms.Count ' Number of open forms.
If intForms > 0 Then
For intI = 0 To intForms - 1
Set frm = Forms(intI)
Debug.Print frm.Name
intControls = frm.Count
If intControls > 0 Then
For intJ = 0 To intControls - 1

If (frm(intJ).Name = "region_id") Then

frm(intJ).RowSource = "SELECT region_name, region_id FROM region ORDER BY region_name;"

End If

If (TypeOf frm(intJ) Is SubForm) Then

intsubControls = frm(intJ).Form.Count

Set subfrm = frm(intJ).Form

For intK = 0 To intsubControls - 1

If (subfrm(intK).Name = "region_id") Then

subfrm(intK).RowSource = "SELECT region_name, region_id FROM region ORDER BY region_name;"

End If

Debug.Print subfrm.Controls(intK).Name

Next intK

Debug.Print intsubControls

End If

Debug.Print frm(intJ).Name

Next intJ

End If
Next intI


MsgBox "No open forms.", vbExclamation, "Form Controls"

End If

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Loop Through All Forms And Controls?
Im working on a project and i have lots of Forms and controls and i would like to loop through all of them and set properties. The problem is, i know how to do it with all the controls in a form but id like to loop through all the forms and controls in the project.

Any ideas?

Thanks in Advance.

Loop Through Forms Controls
How do I loop through forms controls setting the fontsize for each?

Help With Forms And Subforms
I am in the process of building a point of sale system for a local
restaurant in Microsoft Access. I am having problems trying to open a form
(through an on click event) in a subform (located inside the original form).
Once clicked I would like the cmd button to be disabled until one of another
set of cmd buttons are clicked. Does anyone have any idea what the code would look like to produce these results? Any help would be greatly appreciated.
Thankyou for your time.

Forms, Subforms And A Bloody Combo Box!
I have a form, 'view appointments' that has a combo box on it where I can select a doctor. I also have a query that pulls out appointments from the appointments table based on the numerical value, from the combo box on view appointments form. I have created another form based on this query 'view appointments subform' that is a subform in the view appointments form.

What I was trying to do, is when I change the combo box to another doctor, the query criteria should change, thus changing the details in the view appointments subform, however, its not working! I have tried to refresh the form but that still has no effect.

Anyone know what I am doing wrong? I think I may need to run a requery?


External Forms Into One Master Form And Subforms
Hi there,

I was wondering if this problem is solvable?

I have a very extensive array of complex MS Access business solutions and would like to be able to reference them all from the one “master” application.

My vision is to build one “master” application which contains menus to run my many business functions. In essence I want to be able, from within my “master” application, to open forms and reports which are stored within other .mdb or .adp files. The nominated form would open in the window space of the “master application and on the surface would look as if it is part of the “master” application.

I have managed to have my “master” application open the forms and reports in their own Access windows, but not within the “master” application’s own Access Window. Is it at all possible to achieve this?

At the moment my business users have a series of shortcuts on their desktops to each of the many applications they run. I would like to have one shortcut to the master application and all of my business functionality accessible from with the “master” application.

Another reason for adopting this approach is to keep my “applications” a manageable size and not develop one enormous and potentially unmanageable application.

How can it be done please?


Imitating Access's Subforms And Continuous Forms In VB (Studio)
do you know what it looks like in Access when you add a subform, and set the subform to be a continuous form view?

no? maybe i'll post an image later. for now, imagine a picture box sitting on a form. it has a scroll bar on the left, kinda like a multiline text box. in the picture frame is a frame with a bunch of text boxes on it like any old data entry/view form. then there's an identical frame below it with the next record's data, ad nauseum. as you scroll up and down, these frames scroll apporiately.

the way i did this was, in the picture frame i stuck in a scroll bar and a frame full of text box controls (and a couple checkboxes) and labels. the frame (frameRecord) and the controls are all control arrays indexed at 0. at run time i query the database and get values to populate the first record, then i load a duplicate set of the frameRecord and controls in it, and populate the next record, ad nauseum. it worked, and looked really neat. the purpose of the whole thing is to display data; the recordset is locked as readonly.

the problem is, the control arrays embedded in various frames in a control array seems to be too much to handle for VB's garbage collector. I have to manually unload each control, which isn't a big deal, but it's a pain in the *** in development; i'm a bit spoiled by being able to run my program in the interpreter and stop it arbitrarily. also, i started thinking, it'd be a helluva lot less overhead if i used all labels instead of textboxes.

so what i'm wondering, before i start redesigning this thing is what other ways (controls?) could i use to make a neat looking umm, thing that would sorta look like an embedded data report?

i'm also looking at this datarepeater thingie. making my own ocx sounds a little, well, just uncertain. but it seems to be sorta what i was just doing, but i don't know if that'd reduce the amount of resources being used or anything. i've never used the control either so i don't know if it's worth looking into.

anyway, if anyone has any comments, suggestions, or random interjections to make, you know where to find the reply button.

Tabs And Controls
Hi very silly questions but i place a button and textbox on first tab multipage
its visable on all pages this cant be right did i do some thing wrong i thought it would be a tab of like 3 pages with different stuff on each page.

silly question if i am right about differnt stuff on each page could some one give me and example of how cotrol is defined to stuff on each page

like form1.text1.text?

How To Tell Which Controls Are In Which Tabs?
How do I determine if a control if in a certain tab? I can't figure out which property of a control would give me that information. For example, a textbox is in Tab number 2. How would my program get that information?

Tabs In Forms
Can anyone recommend a tutorial on using tabs in forms and getting them to relate back to a recordset to display information. In a sense, the tab should allow me to display info in one form rather than in 4 different forms; but the info will be selected from 1 recordset.


Add Tabs To Forms?
I have used an app that had tabs on the bottom of the display to change forms i believe...How can you do this?

Mdi Forms To Tabs
i have a mdi applications, is there any way i could force all of the mdi windows into tabs on the mdiform? Forms
I've seen tabs done in forms how do I do that?

Forms In Tabs
Is this possible in VB? If so, how? Is it bad design?

I would like my app to have a few multitab dialog screens(about 6 tabs per each dlg).

But I would prefer to use the seperate standalone forms I've created and 'paste' them into each tab. The reason I'd like to do this is because I may also have need to just pop open a single form without the need to pull it up with all the other tabs it is grouped with.

The whole idea about putting tabs together is to keep related info together. But there will be some instances when the user may need screens open from 2 different dialog tab collections. I'd like to do this without having to open the whole tab collection.

thanks in advance for any help

[Custom Controls] Tabs?

Okay, noob question. How do I get my tab control to look like this? I'm really new to VB and I am just a little confused on how to do this. I hope it doesn't have to deal with API.

Thanks in advanced,
-Dren T.

Copy Controls Between Tabs
Hey All:

I have a question regarding copying controls and SSTabs. I have a form with an SS Tab on it and various control on the first tab. I have the form setup so that each tab will be a single request under the overall request which is the entire form. Now when this form starts I have my program prompt the user for the number of individual requests they are making, and then when the form loads it makes the SS Tab have the requested number of tabs on it, however only the first one still has the controls on it and the rest are blank (naturally...I don't expect it to automatically copy over the controls). So my question is....How can I copy the all the controls, labels and combo boxes from the first tab to all the other tabs. I am assuming this will be done by a loop but I’m not sure what the coding is to create a control or what they coding is for placing a control on specific tab??

If anyone could give me a hand I would greatly appreciate it.


Same Controls In Differents Tabs
Dear friends,

I've one SSTab control that has 2 Tabs.
In the Tab0 I've a frame (frameMain) control that has many textbox inside.
When I change the tab (Tab0 to Tab1) I want that this frame (frameMain) and all his controls appear.
In other words, I want that the same frame and his controls appear in any Tab.
How I do this?
Thanks and sorry about my bad English.

Adding Controls To Tabs

i have never used the tabstrip control before and am confused as to how to
place controls on each of the tabs. Is anyone familiar enough with these
controls to give me some advice?



This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom it is addressed. If
you have received this e-mail in error you must not copy, distribute or take
any action in reliance on it. Please notify the sender by e-mail or

Tabstrip Controls - Tabs At Top?
Newbie question.

I am trying to use the tabstrip control in Embedded VB.
However in my application I need the tabs at the top, and they always appear at the bottom, despite the help files (and even the little tabstrip icon) showing them at the top.
Is there any way to change them?

Making Forms With Tabs
how do i make the tabs like the ones you see in options screens and propertys menus of windows?

Place Controls On Tabs At Runtime

I am building a VB6 application I a need to place some controls on custom tabs in a SSTab control at runtime...
Cam anyone help me?

Controls In SSTab Are Switching Tabs!??
When my form is resized...(or code adjusts these 2 list boxes) they jub from tab 2 to tab 3!??
I cant figure out why!

all im doing is adjusting the Left / top and boom...the jump to the next tab...

ive tried deleting them and redrawing them on the tab...

is there any way to "Set" them back to tab 2?
lstTNs.Parent = SSTab.???

Create Tabs And Controls At Run Time

I have difficulty in my application. I don't know what's going wrong. Hope to get any advise from this forum.

I have an SSTab control in my form, and several other controls on the tab. Upon form loading there will be only one tab.
I create control arrays for all my controls on the tab, so that upon clicking a button, I could add another tab with the same controls as my previous tab.

My code looks like this:
Private Sub Command1_Click

SSTab.Tabs = SSTab.Tabs + 1
LoadControls ' Will load all the controls I have on my first tab

SSTab.TabCaption(SSTab.Tabs - 1) = "Step " & SSTab.Tabs
TabIndex = SSTab.Tab

  SSTab.Tab = SSTab.Tabs - 1
  Frame1(SSTab.Tab).Container = SSTab.Tab
  Frame1(SSTab.Tab).Visible = True
  Frame1(SSTab.Tab).Caption = ""
  FrameChoice(SSTav.Tab).Caption = "Choice " & SSTab.Tabs
  FrameChoice(SSTab.Tab).Container = Frame1(SSTab.Tab).TabIndex
  FrameChoice(SSTab.Tab).Visible = True
  Grid1(SSTab.Tab).Visible = True

  SSTab.Tab = TabIndex

ResizeControls 'Will resize and position all my controls

End Sub

I put all the controls in one frame (Frame1). When I run it, only this Frame1 appears in my new tabs, the others do not appear. I could not figure out what went wrong. Anyone could figure out?

Thanks so much.


Tab Control (of 3 Tabs) Contain 3 External Forms. Is It Possible?

Suppose, I have 3 forms(having some controls) saved somewhere in my harddisk. I create 4th form having Tabstrip control(or Tabbed Control) with 3 tabs. Is it possible to put these 3 forms on these 3 tabs??

I hope you got my point. Please reply me.

SSTAB - Dynamic Loading Of Controls Onto Tabs
I can't get the Rich Text Box to load on the second tab. It always loads on the first tab. How can I get dynamic created controls to load on the tabs other than the first one?
Dim RichTextBox1 As Object

Set RichTextBox1 = Me.Controls.Add("RichText.RichTextCtrl.1", "RichTextBox1")
Set RichTextBox1.Container = SSTab1
RichTextBox1.Visible = True

Removing Controls And Tabs With SSTab At Runtime
Hello All,

I've read in previous posts that it's possible to remove tabs from a SSTab control, as long as all controls are removed from the tab you are trying to remove.

In a nutshell: The form contains a drop-down list and a SSTab control. The SSTab control contains one tab with a listbox on that tab. When the drop-down list changes, a new set of tabs and listboxes is loaded, as needed. So, the first selection creates 3 tabs with a separate listbox on each tab. But, when the second selection is chosen, which only needs 2 tabs and their corresponding listboxes, I need to remove the third listbox and the third tab. I get rid of the third listbox okay using Unload lstGroup(a), but when I try to use SSTab.Tabs = SSTab.Tabs - 1 to remove the last tab, I get the error "Invalid Property Value."

How can I find out if all controls are removed from the tab?

I've only got one control on each tab, and I assume Unload got rid of it, but it's not working.

Can anyone help me with this one? (it seems as though brucevde should know... )


Performance Check - Using Tabs Instead Of Multiple Forms
this is what i'm trying 2 do.
i have a SSTab control on my form (frmMain) and have like 10 tabs on them. Each tab has multiple controls in it. The first tab is order details where in a user can enter details of a new order. The second has customer info. The third employee details. So on and so forth. frmMain is the main page and loads when the ap starts.
I would like to know if all the tabs (and controls in each) are loaded at this time and does that consume a lot of resource. Can this slow down the system and also make the ap run slower?
If this happens is it better to have each 'tab' as a separate form for better performance?
awaiting 4 ur replies

Problem With Placing Controls On Different Tabs Of Tabstrip Control?
Hello folks,

I have a tabstrip control with a number of tabs. I can not put controls on different tabs of my choice. Whatever control I want to put on those tabs, ends up on the first tab. How to solve this problem and be able to put any control on any tab? Thanks for your help.

Open Several Tabs In Internet Explorer
hey dudes
i've gotten great help here before!

basically i always check a number of sites when i first go on the net each day,
gmail, sportspages, news, tv guide etc etc
i have written seperate progs to launch internet explorer on each page and assigned thoose progs using tweakui to the "media" buttons on my keyboard.

when my computer starts up i press theese buttons and a number of instances of ie7 launch on the appropriate pages.

the code i'm using for each prog is:


Private Sub FORM_LOAD()
Dim RetVal
RetVal = Shell("C:Program FilesInternet ExplorerIEXPLORE.exe", vbMaximizedFocus)
Unload Me
End Sub

which launchs gmail

now what i'd like to do is have just one prog
that for eg. launches 1 instance of ie7 and 5 tabs
with each tab containing one of the sites i want.

is this possible?
i've googled and searched here a bit but cant find
i've experimented with putting &, AND, TAB between addresses but no joy
and help is greatly appreciated

SSTab: Preventing Controls On Hidden Tabs From Receiving The Focus
Is there a simple way to prevent the focus from moving to a control on a hidden tab during data entry?

Since the TabIndex order for controls runs continuously through all the tabs when the user hits <TAB> on the last control of the active page the focus then jumps to the first control on the next hidden tab rather than cycling only thru the visible controls.

At the very least, is there a way to determine programatically which tab a control resides in? I could use that to mark all the hidden controls as "invisible" which would force the focus to stay on the viewed tab something like this:

Private Sub SSTab1_Click()
   For Each vControl in SSTab1.Container
      If vControl.TabStop Then vControl.Visible = (vControl."ContainerTab" = SSTab1.Tab)
End Sub

But I have no idea how to determine the SSTab tab that a control sits on.


Edited by - Kat on 3/15/2002 4:29:10 PM

Open File Window Hidden Behind All Tabs???
I am using the getopenfilename to try to open a file. I use this line in numerous vba apps and until today the window always appeared "on top" of all the other windows.

today i wrote the code for a new macro and when the program gets to the line it executes and opens the file browse window but it is behind all the windows..

here is some code:
For a = 1 To 10
Application.ScreenUpdating = True
Windows(modelname).Application.ActiveWindow.WindowState = _ xlMaximized

Excel.Application.DisplayAlerts() = True
sfilename = Windows(modelname).Application.GetOpenFilename("All _ files (*.*), *.*")

the few lines starting with "windows. xxxxxxxxx" i inserted hoping it would activate the window and bring it to the front and then the box would be on top of all the other windows but it is not working..

is there some way to ensure that the file browse window will be put to the top??


IExplorer: Open Mutiple WebPages In Tabs
Hi all,

Here's one for ya:

Internet Explorer 7 offers Tabs to hold multiple web pages open at once. Does anyone have a clue as to how I might open a set of web pages on start-up?

I know I can shell out to like so: Shell(“iexplorer.exe”) but this only opens one page.

I can understand how this might be difficult in VB6 as Internet Explorer 7 is a new product. I figured I'd ask though. Looks like a rather challenging task, but I know there are some ace programmers out there (an unashamed appeal to vanity ).


Loop - IF BookX Is Open, Open BookY Until One Is Free
This is a little odd, but I would like to run a loop until a workbook is free to write to it ...

I would like multiple users to write to a book - it doesn't matter which one ... but I don't want them to get any 'wait' 'free to write to' share messages if it's active ...

If I have my book (active) , book1 (closed) and book2 (closed) ..
I would like to run a loop until either book1 or book2 are closed then open the book, write to it, close the book ...

Currently I have -

Application.ScreenUpdating = False
Workbooks.Open ("L:\_FFLSummaryCBsummary_cb.xls")
Worksheets("summary").Range("D5").Value = Range("D5").Value + setttype1
With Workbooks("summary_cb.xls")
.Close False
End With

Can I run a loop until 1 of 2or3 books is free then open, write, close it ?

Thanx anyone for your help !!

Absolutely DUmb
How do i make command 6 popup another window ?

RTB With Absolutely No Formatting
My program needs to work with totally unformatted text. I had the normal text box going just fine but I had to switch to RTB when the files loaded into the text box got way too big for normal text box.

Things are working okay when I load text files in, but I need to be able to enter in text from scratch in the RTB without all that formatting stuff being invisibly added to the text.

Is it possible to make a RTB act like notepad instead of wordpad?

I Am Absolutely Flat Out New To COM And Need Help - Using COM In VB6 To Talk To C EXE

I have no idea what I am doing in COM.

I have tried example after example and reading whatever I could find,
but I seem to be missing something fundamental.

I need to capture certain information from DXF files and send it to a
C executable (WinCad) so that the WinCad will create a list of parts
to be made by a machine we use here. Right now this process is done
by hand.

WinCad is a program written by the manufacturer of the machine, I have
no source code for it.

It appears, to me, that all I need to do is reference WinCad, then
write the code to talk to it. It seems that I am wrong about this.

I am getting the error "Function or interface marked as restricted, or
the function uses an Automation type not supported in Visual Basic."

I know that WinCad can be used that way I am trying to use it. When I
asked if this could be done I was sent VC6.0 source code which, when
complied, uses WinCad to create parts.

I know next to nothing about C. It took me several attempts just to
get the workspace open.

My reference to WinCad was added by Browsing in References to a
TypeLibrary I generated (using the IDL I included below). The
reference does point to the proper file/location. The IDL was created
by copying what I saw in WinCad.exe in the OLEViewer.

Any and all assistance would be GREATLY appreciated - I have been on
this project WAY too long!

My code is run by clicking a button in a form, all I have is the

Option Explicit

Private Sub cmdRun_Click()
Dim objWinCadServer As PartDoc
Set objWinCadServer = New PartDoc

Dim objParts As Long
Set objParts = objWinCadServer.SetPartData("TestJob", _
"Testgrp", "DelMe", 5, 105.2, "", "", "", _
"FB", 386, "", "", 0, 0) 'As Long
End Sub

From the Object Browser:
| WinCad
| Classes: | Members of 'PartDoc'
| <globals> | =\ GetSpecification
| MultDoc | =\ RefPlane
| PartDoc | ...
| ShapeDoc | =\ SetPartData
| WincadProxy | ...
| Function SetPartData(strJobid As String, strGroup As String,
| strMark As String, iQuanity As Integer, dLength As Double,
| strDesctp As String, strDesc As String, strGrade As String,
| strFabcode As String, bMeasureWebDepth As Long,
| strRemarka As String, strRemarkb As String,
| nMeasureSystem As Integer, iChannelLeg As Integer) As Long
| Member of WinCad.PartDoc

Absolutely New To Crsytal Reports 11 And Its Use In VB6....

I have just downloaded and installed the Crystal Report 11 Dev Ed product. On the other hand, I have developed a project with VB 6 & MS ACCESS 2000 (as the database with password protection). The only thing remaining is to create a couple of reports for my project.
After installing & getting the CR11 to be integrated into Visual Studio 6, I have selected the folowing items in the VB6 IDE
These are:

-->References window:
1. Crystal ActivX Report Viewer Library 11.0
2. Crystal Reports ActivX Designer Design and Runtime Library 11.0
3. Crystal Reports ActivX Designer Runtime Library 11.0

-->Components -> Controls window:
1. Crystal ActivX Report Viewer Library 11.0

-->Components -> Designer window:
1. Crystal Reports 11

I have also tried the built-in wizard (from within CR11) that automates the process of report creation. But this automated process is ok for situations where no specific criteria is required to query records from the database, and instead just to simply list all the avialable records of a table.

1. Do I use the same database connectivity code from the VB6 IDE's
code view (that was used for my project) to connect & create
reports in CR11 ?

2. Should the report be designed from:
(a) within CR11 OR....
(b) from the Project Explorer in VB6 IDE and
selecting to add the Crystal Reports module OR....
(c) purely from VB6 code ?

3. How do I provide specific deciding parameteres, upon which
records would be queried ?

Any assistance & help would be gr8tly appreciated....

Have Absolutely No Clue, Don't Even Know Where To Start?
Hi everyone,

I am totally new to Visual Basics, like 1 hour or so!

I've looked for tutorials but nothing really explains to me how it works from scratch.

Imagine if your wanted to learn Chinese but didn't even know how to say "yes" and "no"!

Can anyone point me to the best tutorials out there?

Or can any one tutor me for let's say $20 an hour or so?


How Can I Absolutely Closing My Application?
I built an application in VB6 with so many forms shown in both mode modal and non-modal. In this app i had a main form, calling others form to display, that means when i want to close the main form others opened form must be unloaded. And i did it with these codes below:

VB Code:
dim frm as form      for each frm in app.forms          unload frm      next

This went well when the user click on the exit menu, but if the user click the Close button on the controlbox of the form then my app still stuck in memory.

Can anyone here surggest me a solution?

XP Look And Feel, Absolutely No Badgers!
Does anyone know if it is possible to write VB applications, using VB 6 SP 5 and OS Windows 2000, which have the look and feel of XP programs?

See told you there would be no badgers

Resizing Forms And Forms Controls
How can I solve the problem when the Screen Resolution changes.
Some controls disappear from the form. Is there a way I can
resize everything constantly as the resolution changes?

Can I detect the screen resolution at startup and resize
all forms in my application proportionally to that resolution?



Is DCOM Absolutely Needed MS App To MS App Communication.
Is DCOM absolutely needed MS app to MS app communication.

My app is a Cold Fusion 5.0 based web application. It sits on a PC that is on the network but all the ingredients are on the same PC.
It (my app) uses a CGI method to call a VB 6.0 executable. This VB executable call/triggers MS Visio 2000 as below:

Set appVisio = CreateObject("visio.application")
Set docObj = appVisio.Documents.Open(destFile)

DCOM is somehow detected by some testing group and it causing a security concern; I do not what would happen if it is disabled on the PC housing my app. I know for sure that COM in involved. I also know this:

“Distributed COM (DCOM) is a subset of COM that provides the capability to use COM objects across networks or across the Internet. DCOM extends COM to provide the mechanism for using COM in a networking environment. A detailed discussion of DCOM is beyond the scope of this book, but note that DCOM is definitely prevalent in certain types of network programming.”

Is DCOM Absolutely Needed MS App To MS App Communication?
Is DCOM absolutely needed MS app to MS app communication?

My app is a Cold Fusion 5.0 based web application. It sits on a PC that is on the network but all the ingredients are on the same PC.
It (my app) uses a CGI method to call a VB 6.0 executable. This VB executable call/triggers MS Visio 2000 as below:

Set appVisio = CreateObject("visio.application")
Set docObj = appVisio.Documents.Open(destFile)

DCOM is somehow detected by some testing group and it causing a security concern; I do not what would happen if it is disabled on the PC housing my app. I know for sure that COM in involved. I also know this:

“Distributed COM (DCOM) is a subset of COM that provides the capability to use COM objects across networks or across the Internet. DCOM extends COM to provide the mechanism for using COM in a networking environment. A detailed discussion of DCOM is beyond the scope of this book, but note that DCOM is definitely prevalent in certain types of network programming.”

Loop Through Controls
How would I loop through controls that are in a user control? I know how to loop through controls in a form


Public Sub ChangeFont(X As Form)
Dim Control

For Each Control In X.Controls
Control.Font = vScreenFont
Control.FontSize = vScreenFontSize
Control.FontBold = vScreenFontBold
Control.FontItalic = vScreenFontItalic
Next Control

How would I do that but with a usercontrol? Thanks.

Link Tabs To Command Boxes Simultaneously Update Each Tabs Info
I have about 3 tabs with labels and corresponding text boxes for each tab. On the main part of the form, which is the part that doesn't change when i click on different tabs i have an import, modify, update button.
The import button imports information from Excel into each textbox for one tab but how do i get it to import to the other tabs at the same time?
the information that i need to import is in one file in one column but it needs to span through to 3 tabs. ( i don't want to put all the information from the 3 tabs into one tab.)

I've used a control array and a for next loop to import the info to tab 1 but how do i simultaneously update the other 2 tabs with the rest of the info from the file?

ADO Recordset Not Updating!?! (Absolutely Frustrating)&lt;---RESOLVED
I am trying to edit my record with the following code:

strSQL = "SELECT * FROM [tblEmployee_Availability] WHERE [Emp_ID] = '" & myEmployeeRecordID & "'"
oRSEmployee_Avail.Open strSQL, oConn, adOpenDynamic, adLockPessimistic, adCmdText

With oRSEmployee_Avail
If oRSEmployee_Avail.RecordCount = 0 Then
End If
oRSEmployee_Avail("Monday_Open") = frmEmployees.chkAvailable_Day(0).Value
oRSEmployee_Avail("Monday_Start_Time") = frmEmployees.DTPickerDay_Start(0).Value
oRSEmployee_Avail("Monday_Finish_Time") = frmEmployees.DTPickerDay_End(0).Value
oRSEmployee_Avail("Tuesday_Open") = frmEmployees.chkAvailable_Day(1).Value
oRSEmployee_Avail("Tuesday_Start_Time") = frmEmployees.DTPickerDay_Start(1).Value
oRSEmployee_Avail("Tuesday_Finish_Time") = frmEmployees.DTPickerDay_End(1).Value
oRSEmployee_Avail("Wednesday_Open") = frmEmployees.chkAvailable_Day(2).Value
oRSEmployee_Avail("Wednesday_Start_Time") = frmEmployees.DTPickerDay_Start(2).Value
oRSEmployee_Avail("Wednesday_Finish_Time") = frmEmployees.DTPickerDay_End(2).Value
oRSEmployee_Avail("Thursday_Open") = frmEmployees.chkAvailable_Day(3).Value
oRSEmployee_Avail("Thursday_Start_Time") = frmEmployees.DTPickerDay_Start(3).Value
oRSEmployee_Avail("Thursday_Finish_Time") = frmEmployees.DTPickerDay_End(3).Value
oRSEmployee_Avail("Friday_Open") = frmEmployees.chkAvailable_Day(4).Value
oRSEmployee_Avail("Friday_Start_Time") = frmEmployees.DTPickerDay_Start(4).Value
oRSEmployee_Avail("Friday_Finish_Time") = frmEmployees.DTPickerDay_End(4).Value
oRSEmployee_Avail("Saturday_Open") = frmEmployees.chkAvailable_Day(5).Value
oRSEmployee_Avail("Saturday_Start_Time") = frmEmployees.DTPickerDay_Start(5).Value
oRSEmployee_Avail("Saturday_Finish_Time") = frmEmployees.DTPickerDay_End(5).Value
oRSEmployee_Avail("Sunday_Open") = frmEmployees.chkAvailable_Day(6).Value
oRSEmployee_Avail("Sunday_Start_Time") = frmEmployees.DTPickerDay_Start(6).Value
oRSEmployee_Avail("Sunday_Finish_Time") = frmEmployees.DTPickerDay_End(6).Value
End With

The recordset opens fine and I can even mouseover the recordset variables as I step through the code. However after I close down and open it again the old values are back. Is the problem in the way I open my recordset?

Loop Through Child Controls
Hi, I have several pictureboxes which are contained in another picturebox. What I'm looking to do is loop through all the child pictureboxes within the parent picturebox and check which ones are visible.


Loop Contained Controls
Im missing something i think. Anyone know of an easy way to loop thru the controls inside a container without looping the whole forms control collection?

UserControls have ContainedControls but when your dealing with regular containers such as Frame or PictureBox, theres nothing...

Loop At All Controls In A Form
How can I know what is the type of a control ?

Dim ctlControl as control

For each ctlControl in Me.Controls
    if ctlControl = TEXTBOX then
        'Do something

in the IF statement. How may I know what is the control type. I need to know where the control is a textbox

Loop Forms?
I got ten forms in a project, i would like to know which one is showed. so i wrote

Pravite sub command1_click()
Dim x as integer
x =11
Do while x &gt;0
if form X.visible =true then&lt;-----------This is wrong syntax, anyone can fix it for me please!
print x
en dif

Keep asking question until the end of the world....

Copyright © 2005-08, All rights reserved