[AccessD] Another challenge I need help with

Tina N Fields tinanfields at torchlake.com
Sun Nov 4 10:12:17 CST 2018


Thanks again, to both of you. Yes, it is unbound. Yes, requery is essential.

Progress,
T

Tina Norris Fields
231-322-2787
tinanfields-at-torchlake-dot-com

On 11/4/2018 5:39 AM, Stuart McLachlan wrote:
> I assumed that it was an unbound form or at the least that  combobox was not bound to a
> recordset field if it is a bound form.
>
> You're correct that you should requery either the combobox or the form if it is bound to
> tblPeople.
>
> On 4 Nov 2018 at 2:03, RockySmolin at bchacc.com wrote:
>
>> Don´t forget the requery after delete.  But would
>> DoCommand.RunCommand acCmdDeleteRecord work just as well?
>>
>> r
>> -------- Original Message --------
>> Subject: Re: [AccessD] Another challenge I need help with
>> From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
>> Date: Sat, November 03, 2018 1:00 pm
>> To: Access Developers discussion and problem solving
>> <accessd at databaseadvisors.com>
>>
>> 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
>>
>> -- 
>> 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