Requery or refresh?

  • Thread starter Thread starter warway
  • Start date Start date
W

warway

I want a subform that is placed inside a tab control page to requery/refresh
when a tick box is updated on another subform within antother page in the
tab control. This is project file.adp , I can update things manually by
using SHIFT + F9 but unable to do it in the code, can some one point me in
the right direction please. I'm not sure when I should use .'s or !'s in
the forms frmName subfrmName control bit

Warway
 
Hi,

In the tick box's on click event, enter the following:

Forms!MainFormName!SubFormControlName.Form.Requery ' Or refresh

Note that SubFormControlName is the name of the subform control on the form,
not the name of the sub form itself. It is the same as the sub form name by
default, but if you entered another name for this control, then use that
name instead.

HTH,

Neil.
 
It sort of works...but updates occur in the wrong order.

When I click on the tick box no changes are reflected, when I click again
the first set of changes are reflected


Maybe more info is required...well here goes

I have a main form frmQuote that contains a Tab control with two pages

the first page contains a subform that relates to suppliers for the quote,
therefore more that one record. Each one of these records contains detail
records with items that the supplier is quoting. What I am ticking is
individual items from more than one supplier that are then reflected on the
second page of the tab control which then gives me a summary of the items
and suppliers and costs

When I had this in just an MSAccess 2000 database I used:

Private Sub Chosen_AfterUpdate()
Forms!frmQuote.Refresh
End Sub

on the tick box and it worked fine, now in the .adp it doesn't, as if I have
all Quote records in the recordset the refresh puts me back to the first
record

Warway.
 
ok, when you say you have a tab control with two pages, is the information
being pulled from 2 different tables for each subform (I am assuming there
is a sub form on wach page)? or is it from one table but split over two
forms?

Also, .Refresh will update all edited records, but will not show any
deletions or additions (i think) but the advantage of this is that the form
doesn't go back to the first record. .Requery will requery the form as if it
was opened again showing all additions and deletions but will also move back
to the first record.

HTH,

Neil.
 
The input page is straight into the table, where as the second, display page
is a view with the table and some additional information from other tables
and views

I also use the same from frmQuote for editing and adding information, if I
edit an record is it selected from a list and only that record is in the
recordset and updates work fine, but if I open the frmQuote to add records
any clicking in the tick boxes causes the record to disappear from the
screen and another new blank form appears.

Is their a way that I can open a new record for the add procedure and only
havew one record so it doesn't jump off to a new one?

TIA

Warway
 
Back
Top