hello ... dear how can i delete data of column from subform when i open form ? (1 Viewer)

oday

New member
Local time
Today, 13:15
Joined
Apr 5, 2024
Messages
7
hello ... dear how can i delete data of column from subform when i open form ?
thank you so much
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:15
Joined
Oct 29, 2018
Messages
21,496
Not sure if what you're asking is clear. Did you want to use code when you click on a button? Otherwise, you can just select the record and hit the Del key on your keyboard.
 

LarryE

Active member
Local time
Today, 03:15
Joined
Aug 18, 2021
Messages
592
hello ... dear how can i delete data of column from subform when i open form ?
thank you so much
You can use an Update Action Query and set the values to Null if the field is a text field. But the obvious question I would have is why would you do this?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:15
Joined
Feb 28, 2001
Messages
27,229
First, because of the language you chose, there is an ambiguity. You are using the language of Excel but this seems like it is being asked as an Access topic. A "column" is an Excel concept. Access uses "fields" and you normally don't operate on the same field for all records at once, though the language of your question COULD be interpreted that way.

Ask your question again (in this thread) but clarify what you want to do. And please understand, there are ways to do whatever you wanted to do. It is merely unclear.
 

oday

New member
Local time
Today, 13:15
Joined
Apr 5, 2024
Messages
7
dears all , thank you so much for replay me... dear i have form .. and thereare subform in my main form ,, they concect each other ,, som time i get copy of data as column and put it in one column in my subform ,, in other time i went to delete that data or other column all data in that column not one cell ,, like in excel i can select some cell on one column or in one row and delete in one time .. thank you for undersatn me
 

oday

New member
Local time
Today, 13:15
Joined
Apr 5, 2024
Messages
7
i have one way to do than .. i get copy on null or zero column and past it in any coumn in my sub form to delete that data
 

tvanstiphout

Active member
Local time
Today, 03:15
Joined
Jan 22, 2016
Messages
232
What I understand is that you want to delete the value in one column of the subform, for all rows, as is done here with the Discount field of the Northwind 2 Dev Edition sample database (which then causes Price to be blank as well because of a calculation with null):
1712525493072.png

If I got that right: there is no built-in way to do that. You would either have to select the text in each row, and hit Delete, or you would have to write some VBA code to do it.
 

LarryE

Active member
Local time
Today, 03:15
Joined
Aug 18, 2021
Messages
592
Learn how to use an Update Action query and set the values to Null or 0 or whatever you want.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:15
Joined
Feb 28, 2001
Messages
27,229
The general syntax if you are using SQL might LOOK LIKE this for numeric fields:

Code:
UPDATE mytable SET myfield = 0 WHERE mytable.selectionfield=somevalue ;

The idea is that:
1) you have a table on which the sub-form is based and
2) that field (column) that you want to erase is in that table.
3) The trick is that you only want to erase that field in those records (rows) from that table that were selected by your sub-form's filter or linkage.

We don't know what that linkage looks like because there are a few different ways to do that. But the rows in the sub-form are selected in some way (as represented by the WHERE clause) and therefore,

4) the WHERE clause uses the same selection criteria as the sub-form, so that you only erase the records that would be in the sub-form.

The danger here is that if you don't have a proper WHERE clause, you will erase too much and that wouldn't be good. Therefore, if you don't understand what I meant, it is not safe to blindly attempt it.

I hope that doesn't confuse you too badly because it is clear that English isn't your first language.
 

oday

New member
Local time
Today, 13:15
Joined
Apr 5, 2024
Messages
7
thank you so much for all reply me.. that is kind from all to give me your ideas .. and sorry for my bad language
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:15
Joined
Feb 28, 2001
Messages
27,229
Please don't say "bad language" because you are doing the best you can. We might say "difficult" but not "bad."
 

Users who are viewing this thread

Top Bottom