Question Delete Specific range of date record

maabbas

Registered User.
Local time
Today, 12:29
Joined
Feb 15, 2012
Messages
69
Hi guys,

I want to make a delete query, which delete record between certain dates, I want access to ask user to specify range of date before executing the query.

Thanks
 
How about something like,
Code:
DELETE * FROM yourTable
WHERE theDateField Between Nz([EnterStartDate:], 0) And Nz([EnterEndDate:], 0);
 
How about something like,
Code:
DELETE * FROM yourTable
WHERE theDateField Between Nz([EnterStartDate:], 0) And Nz([EnterEndDate:], 0);


Thanks, for prompt reply, one more question there any way I can password protected the delete query?
 
With using the Query window ! I don't think so. If using a button in a form, yes certainly.
 
With using the Query window ! I don't think so. If using a button in a form, yes certainly.

I saw a video in Youtube, I am in process to create a form which ask the user for management password, I just need a VBA code.
 
If you want a password override procedure I have a demo file for you to play with. Password Box - A variant of Input Box.

Again, this is possible only if you are calling them from Form. I have not come across something like; double clicking the Query from the Query window, and pop up for Password will appear. If you could link the YouTube video I will have a look at it.
 
That is exactly what I said, you have to create a form, with a button on which you can use a Password form (one I have created, for simplicity just one form) and then if the password is verified you can run the delete Query.
 
That is exactly what I said, you have to create a form, with a button on which you can use a Password form (one I have created, for simplicity just one form) and then if the password is verified you can run the delete Query.

The issue is that I don't know VBA, will you help me to create a code?
 
Yes, when Cancel is clicked. It means they chose to ignore the validation, so you can safely close the form. However when OK is clicked you need the value returned from the "Box", so until the validation is over you keep it hidden. This is almost immediate.

PS: I did this Password box, so many months ago, so do not exactly know why and so, but the above description seems to fit the idea behind the statement. If it is not working ping back I will have a look.
 

Users who are viewing this thread

Back
Top Bottom