[AccessD] Another challenge I need help with
Joe O'Connell
JoeO at appoli.com
Sun Nov 4 09:12:17 CST 2018
Maybe it is just my users, but they sometimes need to be protected from themselves from automatically hitting the enter key whenever a msgbox is displayed instead of reading the message. Instead of just acYesNo, I add an option to default to No and to display a question mark so the buttons become vbYesNo+vbDefaultButton2+vbQuestion
Joe O'Connell
-----Original Message-----
From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of Stuart McLachlan
Sent: Saturday, November 3, 2018 4:01 PM
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Another challenge I need help with
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
>
--
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