Solved

Emunerate a form

Posted on 2001-06-19
3
269 Views
Last Modified: 2008-03-10
I have an unbound form due to connecting with SQl Server.

I want to be able to click add new button and clear out any info in any of the controls.

I assume it works by emuneration.

Dim ctl as Control

For Each ctl in ........

Anyone show me how to do this

Thanks

Scottsanpedro
0
Comment
Question by:scottsanpedro
  • 2
3 Comments
 
LVL 4

Expert Comment

by:cas1
ID: 6205672
Dim Frm as From
Dim Ctrl as Control

For Each Ctrl In Frm.Controls
   Debug.Print Frm.Name
Next Ctrl

Hope that helps
0
 
LVL 4

Accepted Solution

by:
cas1 earned 50 total points
ID: 6205679
Sorry... thats right

Dim Frm as From
Dim Ctrl as Control

Set Frm = Forms![YourForm]

For Each Ctrl In Frm.Controls
  Debug.Print Ctrl.Name
Next Ctrl
0
 
LVL 1

Author Comment

by:scottsanpedro
ID: 6205699
Thanks...

That got me along the right road;

code as follows

Dim Frm As Form
Dim Ctrl As Control

Set Frm = Me.Form

For Each Ctrl In Frm.Controls
    If Ctrl.ControlType = acTextBox Then
        Ctrl.Value = ""
    End If
Next Ctrl

Thanks

Scott
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question