Refreshing / Requering Tabbed Sub Forms.

G

Guest

Hi I know there have been a million and one threads about requerying forms,
sub forms and tabs, but I can't seem to get mine working.

I have a main menu form called Main_Menu_Tabbed for which I have a tab
called Phone_Log, within Phone_Log is another tabbed sub form which contains
8 names of the people who each have a telephon log. On the Phone_Log there is
a button called Enter New Form which takes you to a data entry form where you
enter details of the telephone call received.

On the close form buton of the data entry page I have added the code

Forms![Main_Menu_Tabbed]![Phone_Log_Main_Menu].Requery

So that when I go into the individual's phone log, the call just entered
will be there, but this doesn't seem to be working. Any suggestions? Should I
place the code somewhere else? I have tried various places but none seem to
work.

Thanks in advance.
 
P

Penguin

Try this:

Dim ctl As Control
Set ctl = Forms!FormName!ControlName
DoCmd.Requery ctl.Name

Replace FormName with your form name and ControlName with the name of
your control. Remember that a subform is a control on the main form so
use that name. Hope that helps.
 
G

Guest

Hi Penguin can you tell me exactly where I need to put this code?

Thanks.

Penguin said:
Try this:

Dim ctl As Control
Set ctl = Forms!FormName!ControlName
DoCmd.Requery ctl.Name

Replace FormName with your form name and ControlName with the name of
your control. Remember that a subform is a control on the main form so
use that name. Hope that helps.

Hi I know there have been a million and one threads about requerying forms,
sub forms and tabs, but I can't seem to get mine working.

I have a main menu form called Main_Menu_Tabbed for which I have a tab
called Phone_Log, within Phone_Log is another tabbed sub form which contains
8 names of the people who each have a telephon log. On the Phone_Log there is
a button called Enter New Form which takes you to a data entry form where you
enter details of the telephone call received.

On the close form buton of the data entry page I have added the code

Forms![Main_Menu_Tabbed]![Phone_Log_Main_Menu].Requery

So that when I go into the individual's phone log, the call just entered
will be there, but this doesn't seem to be working. Any suggestions? Should I
place the code somewhere else? I have tried various places but none seem to
work.

Thanks in advance.
 
P

Penguin

You should put this in the close buttons code.

Try this:

Dim ctl As Control
Set ctl = Forms!FormName!ControlName
DoCmd.Requery ctl.Name

Replace FormName with your form name and ControlName with the name of
your control. Remember that a subform is a control on the main form so
use that name. Hope that helps.

Hi I know there have been a million and one threads about requerying forms,
sub forms and tabs, but I can't seem to get mine working.

I have a main menu form called Main_Menu_Tabbed for which I have a tab
called Phone_Log, within Phone_Log is another tabbed sub form which contains
8 names of the people who each have a telephon log. On the Phone_Log there is
a button called Enter New Form which takes you to a data entry form where you
enter details of the telephone call received.

On the close form buton of the data entry page I have added the code

Forms![Main_Menu_Tabbed]![Phone_Log_Main_Menu].Requery

So that when I go into the individual's phone log, the call just entered
will be there, but this doesn't seem to be working. Any suggestions? Should I
place the code somewhere else? I have tried various places but none seem to
work.

Thanks in advance.
 

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