|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Delete Type QueryHello, I have a project where I have an Appointment table (ApptDis)
consisting of the fields ApptDate; ApptSheet; ApptID; (&) Path. There is a form with this query as Data source. I'd like to put a "housekeeping" combo box control on the form with all 12 months displayed, when the user selects a month, the query criteria is updated and all the old records from that month are deleted. SQL view of the query is: DELETE ApptDis.ApptDate, ApptDis.ApptSheet, ApptDis.ApptID, ApptDis.Path FROM ApptDis WHERE (((ApptDis.ApptDate)=[Form]![cboADMonth])); This doesn't work because of the ApptDate field formatting (10/1/2007;10/2/2007 etc) The command wizard won't build a button for "delete queries". Is there an expedient way to do this? Thanks in advance for any help or suggestions. 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! Show quote "Paul3rd" wrote: > Hello, I have a project where I have an Appointment table (ApptDis) > consisting of the fields > ApptDate; ApptSheet; ApptID; (&) Path. There is a form with this query as > Data source. > I'd like to put a "housekeeping" combo box control on the form with all 12 > months displayed, when the user selects a month, the query criteria is > updated and all the old records from that month are deleted. > SQL view of the query is: > DELETE ApptDis.ApptDate, ApptDis.ApptSheet, ApptDis.ApptID, ApptDis.Path > FROM ApptDis > WHERE (((ApptDis.ApptDate)=[Form]![cboADMonth])); > This doesn't work because of the ApptDate field formatting > (10/1/2007;10/2/2007 etc) > The command wizard won't build a button for "delete queries". > Is there an expedient way to do this? > Thanks in advance for any help or suggestions. > > > |
|||||||||||||||||||||||