Solved

Emunerate a form

Posted on 2001-06-19
3
285 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

726 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