How to update without closing form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there
I have a form relating to a table "vehicledetails" with a page displaying a
list "availablevehicles" and another page showing a subform relating to
another table "vehiclebookings" and displaying a list "currentbookings".
When I perform an action to place a booking, the "availablevehicle" list
updates immediately, however the "vehiclebookings" list dosent update unless
I close and reopen the Form.
Have tried refresh and requery, to no avail. any ideas
Cheers Ross
 
Are you sure you are doing a Requery on that sub form?

You can usually do a requery like

me.MySubFormContorl.Requery

The above usually will do the trick. You could I suppose FORCE a requery on
the actual sub-from also. If the above don't work, then try the actual form
object, like:

me.MySubFormControl.Form.Requery

Note how we distinguish between the sub-form control, which is just a
control like any other on your form. (this means you can even set what
"form" the sub-form control displays at run time. So, don't confusing the
concept of sub-form being something other then a standard control on your
form.

Anyway, if the neither of the above works, then something else is going on.

I would perhaps force a update of the "main" forms record BEFORE I run any
processing code, and THEN do a requery on the sub-form as above.

So,

me.Refresh - force a disk write of the main form
- this assume your code is running
- in the main form
--- now call your update stuff......
me.MySubFormControl.Requery

The above should work. As mentioned, you might change the above to

me.MySubFormControl.Form.Requery
 

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

Back
Top