Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ok I have Given Up With Multiple subforms 3

Status
Not open for further replies.

smurf01

IS-IT--Management
Jul 6, 2002
470
GB
I have tried without success to have a mainform(frmFluteTypePapers) with 2 subforms
(frmFTPResults) & (frmNewGrade) and get them to requery

Mainform has three comboboxes that get data from a query after the last combo is updated then frmFTPResults show all related records.

Then in the Click event of frmFTPResults I have the following code which opens a pop up form
Code:
Private Sub Form_Click()
Dim stDocName As String
Dim stLinkCriteria As String


    stDocName = "frmNewGrade"
    stLinkCriteria = "[Record_ID]=" & Me![Record_ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub

Then when I click on any record selector in frmFTPResults frmNewGrade shows data related to that record.

So what I tried to do was have frmNewGrade as another subform in the Main Form however no matter what I try I cannot get the second sub form to requery from the onClick event in the first subform

I keep getting messages like "cannot find form frmNewGrade"

I have tried
Code:
Forms![frmnewGrade].Requery
Code:
Forms![frmFluteTypePapers]![frmnewGrade].Requery

but I always get the same message.

Can anyone help, PLEASE!!!!!




Regards

Paul
 
Hi Paul!

Try:

Forms!frmFluteTypePapers!YourSubformControlName.Form.Requery

hth


Jeff Bridgham
bridgham@purdue.edu
 
Hi again!

Thought of something else, try this:

Forms!frmFluteTypePapers!YourSubformControlName.Requery

hth


Jeff Bridgham
bridgham@purdue.edu
 
Jeff,
I have tried both suggestions but neither works. However one improvement i do not get the error message anymore.

It seems like the only way to get it to work is on to keep re-opening the form which then makes it seem like the form is flickering.

Regards

Paul
 
I have been trying to figure this problem out as well.

I have a work-a-round where I close the main form and just open it back up.

I use the following:
DoCmd.Close acForm, "frm_test"
DoCmd.OpenForm "frm_test", acNormal, "", "", , acNormal

I do that and it refreshes. I know it might not be the best way, but I figure something else out that's what I do.

Hope that helps,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Maybe try:

Forms![frmnewGrade].Form.Filter = "[Record_ID]=" & Me![Record_ID]
Forms![frmnewGrade].Form.FilterOn = True
 
sfm6s524,

I have added the code you suggested and it works fine if I open frmNewGrade as a popup before doing the requery however if I try and embed frmNewGrade as a subform then I still get the error "cannot find frmNewGrade" that your macro or visual basic code refers to.

Do you know of anything else I can do ??

Regards

Paul
 
smurf01 - After reading through the thread I wonder if you might be getting crossed up between the name of the subform, and the name of the control on the main form which identifies the subform.

From jebry's post if you notice, the reference is to the control name
Forms!frmFluteTypePapers!YourSubformControlName.Form.Requery

If you bring up the Main form in design view, open up the properties windows, then click on the subform. On the Data tab of the properties window, you should see the property "Source Object", which contains the name of the form. However, if you look on the "Other" properties tab, you'll see a property call Name. It is the value of this Name property that should be inserted for YourSubformControlName in jebry's line of code.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
CajunCenturion,

The name in both "Data Prpoerties" and "Other Properties" is the same frmNewGrade.

I do have a ssample database that i could send if you would like to see it, it is only 292kb in size

Regards

Paul
 
I would then suggest changing the names so there is no ambiguity between them. For what it's worth, my naming convention is as follows:

The Name of Form Object will always be frmNewGrade, and this should also be the value of the Data Properties Source Object. The Name of the control (Other Properties Name) would be subfrmNewGrade.

Then it's always clear when I am referring to the Form (frmNewGrade), or the subform control (subfrmNewGrade).

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
CajanCenturion,
Thanks for the info I will look at what you have suggested and try the various solutions offered to me then

Regards

Paul
 
Cajuncenturion,
I took your advice and on a bckup copy did exactly what you suggested and "VOILA" once that was right then all the other info I had recieved fell into place.

My Thanks to all contributors on this Thread your help has been most appreciated. I seem to be learning all the time. The forms are now working great

"STARS ALL ROUND"

:-D [2thumbsup] :-D

Regards

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top