delete record of the table

  • Thread starter Thread starter fred
  • Start date Start date
F

fred

I need know how delete one record of one table in Access through a comand,i
have to do for Visual Basic,that is to say, put the code, I need help
 
Fred,

I think the key questions here are:
- *when* do you wnat to delete this record?
- how do we identify which record is to be deleted?
 
Steve Schapel said:
Fred,

I think the key questions here are:
- *when* do you wnat to delete this record?
- how do we identify which record is to be deleted?

this is ok, but I need know the code for put en Visual Basic, for that the
comand "delete", work. Example, I want delete the name the one person through
of the comand delete in the form.
 
Fred -

Look up the RunSQL command in Visual Basic Help (not Access Help). Here is
the basic idea:

Dim SQL As String

SQL = "<SQL Statement Goes Here>"

DoCmd.RunSQL SQL
 
Fred,

Well, the focus of this forum is on Macros in Access, which is not VBA. But
anyway, the VBA code you need is:

DoCmd.RunCommand acCmdDeleteRecord
 
Back
Top