Solved

Emunerate a form

Posted on 2001-06-19
3
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

696 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