473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Delete All Lines

I have a form with about 15 to 20 lines. Their names are LineXXX. What code
can I put in the click event of a button to delete all the lines?

Thanks!

Rolf
Nov 13 '05 #1
3 1628
Rolf wrote:
I have a form with about 15 to 20 lines. Their names are LineXXX. What code
can I put in the click event of a button to delete all the lines?

Thanks!

Rolf

On error resume next
For i = 1 to 20
l = "Line" & i
Me("Line" & i).Visible = False
Next i

Nov 13 '05 #2
Thanks for your quick response!

I would like to delete the lines; not make them invisible. Is there a way?

Rolf
"Salad" <oi*@vinegar.com> wrote in message
news:rI*****************@newsread1.news.pas.earthl ink.net...
Rolf wrote:
I have a form with about 15 to 20 lines. Their names are LineXXX. What code can I put in the click event of a button to delete all the lines?

Thanks!

Rolf

On error resume next
For i = 1 to 20
l = "Line" & i
Me("Line" & i).Visible = False
Next i

Nov 13 '05 #3
Rolf wrote:
Thanks for your quick response!

I would like to delete the lines; not make them invisible. Is there a way?

Rolf
"Salad" <oi*@vinegar.com> wrote in message
news:rI*****************@newsread1.news.pas.earthl ink.net...
Rolf wrote:

I have a form with about 15 to 20 lines. Their names are LineXXX. What
code
can I put in the click event of a button to delete all the lines?

Thanks!

Rolf


On error resume next
For i = 1 to 20
l = "Line" & i
Me("Line" & i).Visible = False
Next i


Can you open the form in design mode, click on the offending lines, and
press the Delete key? Even if you use code, you'll have to open them up
in design view to delete.

Here's some code. It won't delete all for the controls...the For/Each
is interrupted by the deletion of controls...but enough get deleted to
put you on track. Copy a form with lots of controls and run this code.
Then open the form in design mode and check it out.

Sub DeleteControlsOnForm()
Dim ctl As Control
Dim frm As Form
DoCmd.OpenForm "Test", acDesign, , , , acHidden
Set frm = Forms!test
For Each ctl In frm.Controls
'optional debug statement
Debug.Print ctl.Name
DeleteControl frm.Name, ctl.Name
Next ctl
Set ctl = Nothing
Set frm = Nothing
DoCmd.Close acForm, "test", acSaveYes

MsgBox "Done"
End Sub
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: deko | last post by:
I'm not sure how to do this in php - need to calculate and delete an unspecified number of lines from the *top* of a file. <?php //append $visitor to the bottom of $visdata $fp =...
7
by: Srinivasa T.N. | last post by:
Hi, I want to delete the first 3 lines and last 3 lines of a file. How can I do it? I want to repeat on multiple files.. TIA Regards, Seenu.
3
by: Stewart Graefner | last post by:
What do I need to use to be able to make information in a table be deleteable by a User? The table I have tracks Vacation time. It has two fields Vacation Dates and Days taken(Default value 0). The...
1
by: nasirmajor | last post by:
dear all, Please any urgent help regarding following code. i have the following code ================================================================= public void Delete(Object sender,...
3
by: Kevin M | last post by:
I have one table and have created a form from that table. Also, I have created a delete query. I want to but a button on the form which will delete all records from the table; however, I cannot get...
24
by: biganthony via AccessMonster.com | last post by:
Hi, I have the following code to select a folder and then delete it. I keep getting a Path/File error on the line that deletes the actual folder. The line before that line deletes the files in...
2
by: Francesco Pietra | last post by:
Please, how to adapt the following script (to delete blank lines) to delete lines containing a specific word, or words? f=open("output.pdb", "r") for line in f: line=line.rstrip() if line:...
0
by: Francesco Pietra | last post by:
I forgot to add that the lines to strip are in present case of the type of the following block HETATM 7007 O WAT 446 27.622 34.356 55.205 1.00 0.00 O HETATM 7008 H1 WAT...
6
by: Annalyzer | last post by:
My database must produces a .csv file with a header line that is different from the detail lines. This .csv file contains a monthly report to an outside agency and is uploaded online so it must...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.