Solved

Emunerate a form

Posted on 2001-06-19
3
241 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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 stored procedures 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 Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now