[AccessD] Another challenge I need help with

Stuart McLachlan stuart at lexacorp.com.pg
Sat Nov 3 15:00:45 CDT 2018


The way I do this is something like:

Assuming the bound column is cboPepole is PE_ID, then

Sub CmdDelete_OnClick:

If msgbox,"Are you sure you want to delete this record",acYeseNo,"About to delete Record" = 
vbYes Then

    CurrentDb.Execute "Delete * from tblPeople where PE_ID = " & cboPeople
    Msgbox ""Record Deleted"

Else

   Msgbox "Deletion  cancelled"

End If

End Sub


On 3 Nov 2018 at 13:29, Tina N Fields wrote:

> Hi All,
> 
> Here's what I'm trying to do:
> 
> A combobox shows the list of individuals in the database
> The user selects a particular individual from the combovox
> The user clicks a button to delete that individual's record from the
> tblPeople A message box pops up to ask "Are you sure you want to
> permanently delete this record?" The user responds either with a 'Yes"
> or a "Cancel." If the user clicks "Yes," that individual record is
> deleted from the tblPeople.
> 
> I have the form with the combobox in place. It is populated with a
> query selecting the individual's ID, the individual's name, the family
> name (not always the same as the indifidual's last name), and the
> assigned family code. The bound column is the PE_ID, which is not
> displayed. (The family name and code are just so the user can be sure
> which John Smith is being selected, in case of more than one in the
> database.)
> 
> I need help figuring out the rest of this. Any ideas?
> 
> Thanks,
> T
> 
> -- 
> Tina Norris Fields
> 231-322-2787
> tinanfields-at-torchlake-dot-com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list