Nevermind!
I figured it outmyself by using an unbound form (DeleteAppts) and a text box
(Text9) with a short date input mask and the following:
DELETE ApptDis.ApptDate, ApptDis.ApptSheet, ApptDis.ApptID, ApptDis.Path
FROM ApptDis
WHERE (((ApptDis.ApptDate)<[Forms]![DeleteAppts]![Text9]));
Sometimes just writing out the question helps with the solution.
Thanks Anyway!
> Hello, I have a project where I have an Appointment table (ApptDis)
> consisting of the fields
[quoted text clipped - 12 lines]
> Is there an expedient way to do this?
> Thanks in advance for any help or suggestions.
Ken Sheridan - 01 Dec 2007 16:24 GMT
If you do it that way it would be advisable to declare the parameter. Its
always best to do this with date/time parameters as a value in the text box
in short date format could otherwise be interpreted as an arithmetical
expression rather than a date and give the wrong result, so the delete query
would be:
PARAMETERS [Forms]![DeleteAppts]![Text9] DATETIME;
DELETE *
FROM ApptDis
WHERE ApptDate < [Forms]![DeleteAppts]![Text9];
Your first method, using a combo box, would work with a small amendment to
the query. Lets assume the items in the combo box's list are the full month
names, January, February etc, then you get the query to delete rows where the
ApptDate formatted as the full month name matches the value selected in the
combo box:
PARAMETERS [Forms]![DeleteAppts]![cboADMonth] TEXT;
DELETE *
FROM ApptDis
WHERE FORMAT(ApptDate,"mmmm") = [Forms]![DeleteAppts]![cboADMonth];
Note that this time the parameter is declared as text as the Format function
returns a value of
Variant(String) data type.
Ken Sheridan
Stafford, England
> Nevermind!
> I figured it outmyself by using an unbound form (DeleteAppts) and a text box
[quoted text clipped - 23 lines]
> > Is there an expedient way to do this?
> > Thanks in advance for any help or suggestions.