Multi records delete (1 Viewer)

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
How can i delete only the checked records
 

Attachments

  • FakeCheckbox.accdb
    800 KB · Views: 69

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
Where Checked = true ?
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
Can you give me the code on click
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
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'
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
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

  • TickBoxTemp.accdb
    480 KB · Views: 61

isladogs

MVP / VIP
Local time
Today, 18:55
Joined
Jan 14, 2017
Messages
18,261
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

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
How can do that.Im new in access.Thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:55
Joined
May 7, 2009
Messages
19,246
see the code on the "delete" button.
 

Attachments

  • TickBoxTemp.accdb
    608 KB · Views: 53

jdraw

Super Moderator
Staff member
Local time
Today, 13:55
Joined
Jan 23, 2006
Messages
15,395
@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.;)
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
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?
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
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: 58
  • Screenshot (2).png
    Screenshot (2).png
    77.4 KB · Views: 58
  • Screenshot (3).png
    Screenshot (3).png
    77.7 KB · Views: 57

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
Like that i want
 

Attachments

  • TickBoxTemp.accdb
    1 MB · Views: 58

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
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

  • TickBoxTemp (1).accdb
    856 KB · Views: 61

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
Thank you so muck.That i want to do.Thank you again.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
You would need to apply the same logic if Select All is deselected.
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:55
Joined
Sep 21, 2011
Messages
14,429
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?
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
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
 

mikekal

Member
Local time
Today, 10:55
Joined
Jun 24, 2017
Messages
114
No i have data but returns that:
 

Attachments

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

Users who are viewing this thread

Top Bottom