Form requerying

J

Junior

I found a recent discussion here about requerying and saving. would
appreciate a explanation of what events should be requeryed and/or saved -
for some reason i have a hard time understanding how this works

FormMain data source is TableMain
FormOther data source is TableOther
FormMain has a cbobxOther that references TableOther
FormMain also has a cmdbutton to open FormOther to add data to TableOther

When i add data to FormOther it doesn't update TableOther until FormOther
closes - how can i make it update immediately?

When i open FormOther from FormMain using cbobxOther and update data in
FormOther it doesn't
update cbobxOther until i close and reopen FormMain
How can i get cboboxOther to display the updated data immediately?
 
M

Marshall Barton

Junior said:
I found a recent discussion here about requerying and saving. would
appreciate a explanation of what events should be requeryed and/or saved -
for some reason i have a hard time understanding how this works

FormMain data source is TableMain
FormOther data source is TableOther
FormMain has a cbobxOther that references TableOther
FormMain also has a cmdbutton to open FormOther to add data to TableOther

When i add data to FormOther it doesn't update TableOther until FormOther
closes - how can i make it update immediately?

When i open FormOther from FormMain using cbobxOther and update data in
FormOther it doesn't
update cbobxOther until i close and reopen FormMain
How can i get cboboxOther to display the updated data immediately?


Make sure that formother saves the new/modified record
before procedding with form main. I don't how your users
indicate that they are done entering the record's data, but
whatever it is, you can use that event to execute a line of
code:
Me.Dirty = False

The next step in the process would be to requery the combo
box. If nowhere else is appropriate you could do it right
after the above statement:
Forms!FormMain.cbobxOther.Requery

However, if form other is activated from the combo box's
NotInList event procedure, setting the Response argument
will do the requery for you.
 

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

Top