Refreshing Subform (1 Viewer)

cowboymb

Registered User.
Local time
Yesterday, 21:25
Joined
Oct 8, 2011
Messages
11
I have tried to refresh the records of a subform after update. What I end up getting is the subform opening up in a different window. How can I keep the subform from opening up and staying part of the Master form?
 

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:25
Joined
Jul 23, 2008
Messages
35
Try:
Code:
Me.NameOfSubform.Requery
 

cowboymb

Registered User.
Local time
Yesterday, 21:25
Joined
Oct 8, 2011
Messages
11
I tried that and it didn't work. It still opened up in a new window.
 

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:25
Joined
Jul 23, 2008
Messages
35
If you can post your code I can get a better idea what's going on. I've never had .Requery do this.
 

cowboymb

Registered User.
Local time
Yesterday, 21:25
Joined
Oct 8, 2011
Messages
11
This is the code I put in for the refresh of the data

Private Sub File_Name_AfterUpdate()
Me.[File Name].Refresh
End Sub
 

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:25
Joined
Jul 23, 2008
Messages
35
Well I'm stumped. Maybe someone else can figure it out.
 

boblarson

Smeghead
Local time
Yesterday, 18:25
Joined
Jan 12, 2001
Messages
32,059
First off, you would refer to the Subform CONTROL that houses the subform on the parent form like this:

Me.SubformControlNameHere.Form.Requery

but if the code is actually ON the subform (if File_Name is on the subform itself) then you would just use Me.Requery.

So does this happen to be an Access 2010 database and are you using the new Navigation Tab control?
 

cowboymb

Registered User.
Local time
Yesterday, 21:25
Joined
Oct 8, 2011
Messages
11
So does this happen to be an Access 2010 database and are you using the new Navigation Tab control?

This is Access 2010 and yes I am using Navigation Tabs Control.

I tried the code above and it still opens the form in a separate window.
 

boblarson

Smeghead
Local time
Yesterday, 18:25
Joined
Jan 12, 2001
Messages
32,059
Yes, since the navigation tabs control is a WEB control, it would appear that it is using some settings in your web browser for always opening a new link in a new window. I've had other people have similar issues. I'm not sure that is something that can be overcome by simple means. I know it probably can by you going to your Internet Options and making sure to select the current tab or window (which can cause other issues). It could be a problem if you have to have each user do that. So, you might be better off not using the navigation tabs control.
 

cowboymb

Registered User.
Local time
Yesterday, 21:25
Joined
Oct 8, 2011
Messages
11
The odd thing is that when I go to the home menu and press refresh the records refresh in the tabular form that I have them. But when I use the code to refresh them they open up in another window.
 

boblarson

Smeghead
Local time
Yesterday, 18:25
Joined
Jan 12, 2001
Messages
32,059
Not all that odd given that they are two different methods of doing the same thing. Just because they do the same thing doesn't mean that they go about it in the same way.
 

Users who are viewing this thread

Top Bottom