Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete records in a column Only

Status
Not open for further replies.

djmoney

Programmer
Sep 28, 2006
1
US

I'm trying to delete just ONLY the records inside of the column, Not the whole ROW. But I just don't get it. This is what I used.

DoCmd.RunSql "DELETE tblMasterProfileSheet.QTY FROM tblMasterProfileSheet"

Everytime when I execute that script, it's deleting the whole row. I just want to delete records inside of the QTY column, not the ROW.
 
You don't want to delete "records". You want to set values to Null.
Code:
Dim strSQL As String
strSQL ="UPDATE tblMasterProfileSheet " & _
   "SET QTY = NULL"
DoCmd.RunSql strSQL


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
You wanted this ?
DoCmd.RunSQL "ALTER TABLE tblMasterProfileSheet DROP COLUMN QTY"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top