requery of list box not working

G

Guest

A user types an account # on the main form then hits "View Status". A list
box displays the data in the database that is associated with that account.
The user then double-clicks one or more lines in the list box. A new data
entry form pops up that allows the user to enter more data associated for the
lines the double-clicked. After they have made changes on this form, they
hit "Save" which I have programmed to close this form and re-open the main
menu that has the listbox, then requery the listbox to show new/modified
data. For some reason the requery does not show the new/modified info.
Still shows the old info. For example, they modified the date field on a
record, but the modified value does not show up. It still shows the old date
that was there when they originally double-clicked that listbox item.

It almost seems as if the close action of the data entry form isn't complete
yet b/c I see it still open when I look in the Windows Menu. I think that
b/c that isn't closed yet, the save really hasn't occured to the table yet.
How can I make my procedure ensure the form has completely closed before it
does the next step, which is to return to the main menu and requery the data
that was entered on the previous form??
 
G

Guest

I solved this issue, but I don't understand why the change worked. All I did
was remove the form name from the 1st line:
docmd.close acform,"frmDataEntry"
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

to read the following:
docmd.close
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

How does this close the form sufficiently for my requery but not the former??
 
A

AccessVandal via AccessMonster.com

Hi,

You cannot close the same form with the event.

"docmd.close acform,"frmDataEntry" - because the on click event is still
running.

I solved this issue, but I don't understand why the change worked. All I did
was remove the form name from the 1st line:
docmd.close acform,"frmDataEntry"
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

to read the following:
docmd.close
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

How does this close the form sufficiently for my requery but not the former??
A user types an account # on the main form then hits "View Status". A list
box displays the data in the database that is associated with that account.
[quoted text clipped - 14 lines]
does the next step, which is to return to the main menu and requery the data
that was entered on the previous form??
 
G

Guest

Upon further testing my other variant of the close command doesn't work
either. I think I see why with what you say below, but how can I get the
form I am on to close before doing the requery on the form I open?

AccessVandal via AccessMonster.com said:
Hi,

You cannot close the same form with the event.

"docmd.close acform,"frmDataEntry" - because the on click event is still
running.

I solved this issue, but I don't understand why the change worked. All I did
was remove the form name from the 1st line:
docmd.close acform,"frmDataEntry"
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

to read the following:
docmd.close
docmd.open acform, "frmMainMenu"
call requery(lstbox1)

How does this close the form sufficiently for my requery but not the former??
A user types an account # on the main form then hits "View Status". A list
box displays the data in the database that is associated with that account.
[quoted text clipped - 14 lines]
does the next step, which is to return to the main menu and requery the data
that was entered on the previous form??
 
A

AccessVandal via AccessMonster.com

Hi,

Is the "Save" button is on the form "frmDataEntry"?

Try moving the "DoCmd.Close" to the last line of the event.

-docmd.open acform, "frmMainMenu"
-call requery(lstbox1)
-docmd.close '--- move this line just before the End Sub
Upon further testing my other variant of the close command doesn't work
either. I think I see why with what you say below, but how can I get the
form I am on to close before doing the requery on the form I open?
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top