Multi records delete

mikekal

Member
Local time
Yesterday, 18:50
Joined
Jun 24, 2017
Messages
114
How can i delete only the checked records
 

Attachments

Can you give me the code on click
 
Can you give me the code on click
No, because I do not even know what your table is called or the fieldnames.
Have a Google for 'delete query access'
 
I would like in my example when I filter the name, all the records that I will check with check all to be deleted by pressing delete.But not all, only the filtered.Thank you
 

Attachments

Looking at the first example, add the Check field as a boolean field in your table.
You can then use
Code:
DELETE * FROM dtaNames WHERE Check=True;

Modify the same idea for your second example
 
@mikekal
If this data is important to you or your business, then Backup your database in advance. Deletes can be very unforgiving if you make an error.;)
 
thank you for your code but still when filter and SELECT ALL when delete record delete all records of table.That i want is delete only the filter record when im doing that.Thank you again
 
thank you for your code but still when filter and SELECT ALL when delete record delete all records of table.That i want is delete only the filter record when im doing that.Thank you again
That is what the Select All will do? :(
You are meant to select just those you want to delete. That option just saves you having to click each in turn?

It works fine for me?
 
I want something like that.If i have a lot off records when filtering and selecting all with chechbox,delete only the filtering records
 

Attachments

  • Screenshot (1).png
    Screenshot (1).png
    90 KB · Views: 94
  • Screenshot (2).png
    Screenshot (2).png
    77.4 KB · Views: 95
  • Screenshot (3).png
    Screenshot (3).png
    77.7 KB · Views: 90
See if this is more to your liking.
We are here to help though. not write code for you? :(
Whilst Arnel will do so, I generally will not unless it interests me. Normally I will give pointers/links as per my signature.

This is just building on what Arnel supplied.

However if you cannot implement these changes, then perhaps Access is not for you?
 

Attachments

Thank you so muck.That i want to do.Thank you again.
 
You would need to apply the same logic if Select All is deselected.
 
I have another question.I have a form with filter.When im clear filter the date field returns 30/12/1899.Can i solve that.That problem made after put the code of the TickBoxTemp base.Thank you
 
I have another question.I have a form with filter.When im clear filter the date field returns 30/12/1899.Can i solve that.That problem made after put the code of the TickBoxTemp base.Thank you
Sounds like you are putting zero in the date field?
Your sample had no such data, so all down to you?
 
On clear filter have that code:

Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As control


Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As control

'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
cboItem.Value = Null
cboSupplier.Value = Null
txtStartDate.Value = Null
txtEndDate.Value = Null
Case acCheckBox

cboItem.Value = False
cboSupplier.Value = False
txtStartDate.Value = False
txtEndDate.Value = False
End Select
Next
'Me.cboSupplier = "(ÅéóÜãåôå êùä. êßíçóçò)"
'Me.cboItem = "ÅéóÜãåôå ðñïéüí"
'Me.cboItem.ForeColor = 11250603
'Me.txtStartDate = "ÅéóÜãåôå ðñïéüí"
'Me.txtStartDate.ForeColor = 11250603
'Me.txtEndDate = "ÅéóÜãåôå ðñïéüí"
'Me.txtEndDate.ForeColor = 11250603
'Remove the form's filter.
Me.FilterOn = False

Me.txtEndDate.Enabled = False

'Label234.Visible = True
'Label277.Visible = True
'Label260.Visible = True
'Label278.Visible = True
End Sub
 
No i have data but returns that:
 

Attachments

  • Screenshot (4).png
    Screenshot (4).png
    72.5 KB · Views: 97

Users who are viewing this thread

Back
Top Bottom