[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Emunerate a form

Posted on 2001-06-19
3
Medium Priority
?
315 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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

656 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