By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

Refresh a subform within a subform within a Form

P: 17
I have a "Dashboard" in a tool I am building which has a list of different buttons. Clicking on each button will display different subforms which show up in a window to the right of the menu.

One of these "Screens" has a subform which needs to be refreshed after updating one of the other "Screens." The problem is, the screens do not refresh when switching between screens with the menu buttons.

Is there a way to have the subform within the subform within my Dashboard to refresh with a button pressed on my Dashboard?

I have attached a screenshot of my Dashboard....

Attached Images
File Type: jpg untitled.JPG (21.8 KB, 215 views)
Mar 12 '08 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 31,433
You may find Referring to Items on a Sub-Form helpful :)

You will need to call a ReQuery of the relevant subform.
Mar 13 '08 #2

P: 17
I have tried using the External Syntax as described in your thread. After updating a combobox on one of the SubForms (Form1 for example) within my dashboard I need it to update the subform within Form1... to do this I have the following code:

Expand|Select|Wrap|Line Numbers
  2. Dim strQuery As String
  4. strQuery = "SELECT * FROM TableName WHERE Criteria = " & combobox_Value
  6. Forms!Dashboard.Form1.subfrmWithinForm1.RecordSource = strQuery
  8. Forms!Dashboard.Form1.subfrmWithinForm1.Requery
I get the following error at the .RecordSource Line:

"Object Doesn't Support This Property or Method"

I have assigned a RecordSource to a SubForm Before, so I am not sure of the problem. Any suggestions?

Thanks for the help.
Mar 13 '08 #3

Expert Mod 15k+
P: 31,433
At a quick glance (all I have time for at the moment) I would guess that you are calling a ReQuery on the subform control on your form rather than the form that is in it.

This is covered in the HowTo so have another look. If you're still not able to get it to work then post back but include all the relevant details (names etc) of the items and I'll see what I can manage for you.
Mar 13 '08 #4

P: 17
I figured it out. I just used the "Me!subform" reference and it worked. I think I was trying to make the code more complicated than it needed to be. Thanks for the help.
Mar 13 '08 #5

Expert Mod 15k+
P: 31,433
Easily done in complicated areas, and this is certainly one of those. Congratulations for finding the solution. Even better that it's a simple and neat solution :)
Mar 13 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.