dbTalk Databases Forums  

Small logic issue with deleted records

comp.database.ms-access comp.database.ms-access


Discuss Small logic issue with deleted records in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Derrick
 
Posts: n/a

Default Small logic issue with deleted records - 06-02-2005 , 01:36 AM






Hi,

I have a small, non-fatal problem with my interface.

I have main form and subform. The main form contains a list box, to which
records are selected in the subform. At the bottom of the main form is a
Delete button, which calls a dialog box that chooses the record (based on
the WHERE condition that matches up the fields).

When I run my Delete button macro, it triggers a delete query, removing the
selected record. It then closes the dialog and the main form. It reopens the
main form to "reset" the listbox.

Pressing the Delete button again displays the dialog box, which shows the
same record as was previously deleted. Closing the dialog box, and clickling
the Delete macro yet again then brings up the correct, newly selected record
in the dialog box.

I have tried requerying, to no avail. I now open up the dialog box, and open
it up again in the same macro. It works, but requires that I actually close
the same dialog box twice in the macro.

This is transparent to the user, but it sure is clumsy programming. I think
the table has to be closed and reopened to "clear" the deleted records, but
I can't figure out the correct sequence.

Thanks for reading this and thanks for any ideas.





Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: Small logic issue with deleted records - 06-02-2005 , 08:38 AM






Hi:
I'm confused.
This seems a lot of work for a simple delete.
If the list box makes the record in the subform the "current" record,
then a simple delete button on the subform will take care of the
problem.
Is there a reason you aren't doing that?

Good Luck
Ira Solomon

On Thu, 02 Jun 2005 06:36:55 GMT, "Derrick" <fkohr (AT) earthlink (DOT) net>
wrote:

Quote:
Hi,

I have a small, non-fatal problem with my interface.

I have main form and subform. The main form contains a list box, to which
records are selected in the subform. At the bottom of the main form is a
Delete button, which calls a dialog box that chooses the record (based on
the WHERE condition that matches up the fields).

When I run my Delete button macro, it triggers a delete query, removing the
selected record. It then closes the dialog and the main form. It reopens the
main form to "reset" the listbox.

Pressing the Delete button again displays the dialog box, which shows the
same record as was previously deleted. Closing the dialog box, and clickling
the Delete macro yet again then brings up the correct, newly selected record
in the dialog box.

I have tried requerying, to no avail. I now open up the dialog box, and open
it up again in the same macro. It works, but requires that I actually close
the same dialog box twice in the macro.

This is transparent to the user, but it sure is clumsy programming. I think
the table has to be closed and reopened to "clear" the deleted records, but
I can't figure out the correct sequence.

Thanks for reading this and thanks for any ideas.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.