Requerying a 'form' (that uses a table as a record source)

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

Guest

Hello!

I have a 'tab control' on a form. I have (3) pages for the tab control.
Page (1) has a form that I 'dragged & dropped' on the form. This form uses a
'table' set as the form's 'record source'. I can add & delete records on
this form. I want to 'requery' this form (i.e., after I have gone to another
page with forms to query the table for items I check and can delete from this
page). When I go back to the Page (1) form, of course it has the '#delete'
there. I want to 'update' the form on Page (1) with the 'current' table but
I want to do it 'on the fly' from the previous page (i.e., in the
'tab_Change()' event) .

I can get basically to this point...

Private Sub tabControlContainer_Change()

If (Me.tabControlContainer.Value = 0) Then
Me.tabControlContainer.Pages(0) ... 'Lost after this!!
End If

End Sub
 
When referencing controls on a tab control, you DO NOT reference the tab
control in any way.

In general it would be:

Forms!MainForm!SubFormControl.Requery

Replace "MainForm" with the actual name of your main form and replace
SubFormControl with the actual name of the sub form control.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Thanks alot for the info...! I put your code in the form's_Enter event and
it worked great!!

--
Thanks!
Soddy


Roger Carlson said:
When referencing controls on a tab control, you DO NOT reference the tab
control in any way.

In general it would be:

Forms!MainForm!SubFormControl.Requery

Replace "MainForm" with the actual name of your main form and replace
SubFormControl with the actual name of the sub form control.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top