Chuck Lowe
asked on
SUBFORM on ACCESS 2013
I'm working on an Access app (2013). I had to move a form with a subform/subreport under a form that also had a subform/subreport. I'm having issue recoding some. I can't find anywhere on the web or in books the keywords in the calls for !subcontent !subsection . Here is the code. Its dieing on the last Forms statement. I really need help with the documentation on how to call the forms and procedures correctly. Like I said I can't find info on !subcontent or !subsection.
I know it should be calling the UpdateRecoveryDetails of the current form I'm on but it errors out. The error states it can't find the procedure on the form (popup) that is calling it and it should be calling it from the subform that called the popup screen.
Public Sub RefreshRecoveryDetails(ByV al lngProjectID As Long)
' Refresh recovery details if it is visible.
If (IsProjectOpen(lngProjectI D)) Then
If (Forms!frmMain!subContent! subSection .SourceObj ect = "frmProject_Quality") Then
If (Forms!frmMain!subContent! subSection !subQualit yInformati on.SourceO bject = "frmProject_Quality_Feedba ck") Then
Forms!frmMain!subContent!s ubSection! subRecover yInformati on.Form.Up dateRecove ryDetails
End If
End If
End If
End Sub
I know it should be calling the UpdateRecoveryDetails of the current form I'm on but it errors out. The error states it can't find the procedure on the form (popup) that is calling it and it should be calling it from the subform that called the popup screen.
Public Sub RefreshRecoveryDetails(ByV
' Refresh recovery details if it is visible.
If (IsProjectOpen(lngProjectI
If (Forms!frmMain!subContent!
If (Forms!frmMain!subContent!
Forms!frmMain!subContent!s
End If
End If
End If
End Sub
ASKER
@crystal (strive4peace)
Thanks for your info so far. Yes the UpdateRecoverDetails is a PUBLIC. As I stated I had to move this under another subform. I'm confused as to why you are using the Call and periods and our code uses "!" The original code worked before I moved it. I'm sure it's a simple thing as you said I'm missing something, probably simple. It looks like I'm loosing the current form it's on (under subform subRecoveryInformation). I could try to figure it out myself if I could find documentation for using !subcontent, !subsection etc. I can't find that anywhere on the web or any manuals. That would be a great help.
So basically the process calls a subform (under SubQualityInformation) called frmProject_Quality_Feedbac k and that in turn can call up to 5 other subforms under (subRecoveryInformation). As I said it seems to be loosing the subform that I'm calling the popup screen from.
Is it not possible to have forms and subforms call other forms and subforms? Is there a limit or does it loose it's place?
I'm up against a project deadline and really could use all the help given.
Thanks in advance.
Thanks for your info so far. Yes the UpdateRecoverDetails is a PUBLIC. As I stated I had to move this under another subform. I'm confused as to why you are using the Call and periods and our code uses "!" The original code worked before I moved it. I'm sure it's a simple thing as you said I'm missing something, probably simple. It looks like I'm loosing the current form it's on (under subform subRecoveryInformation). I could try to figure it out myself if I could find documentation for using !subcontent, !subsection etc. I can't find that anywhere on the web or any manuals. That would be a great help.
So basically the process calls a subform (under SubQualityInformation) called frmProject_Quality_Feedbac
Is it not possible to have forms and subforms call other forms and subforms? Is there a limit or does it loose it's place?
I'm up against a project deadline and really could use all the help given.
Thanks in advance.
could you post a sample database or a labeled screenshot so we can visualize what you are trying to do?
anytime you reference controls on a subform, unless you want the container properties such as Left or Top, you should follow the formname with ".form"
bang vs dot ... I usually use .
>> Is it not possible to have forms and subforms call other forms and subforms? <<
yes but there may be an issue if the calling form is in dialog mode, sorry to say, since it must be closed before anything else can happen with another form ... perhaps change it to a procedure in a standard module?
anytime you reference controls on a subform, unless you want the container properties such as Left or Top, you should follow the formname with ".form"
bang vs dot ... I usually use .
>> Is it not possible to have forms and subforms call other forms and subforms? <<
yes but there may be an issue if the calling form is in dialog mode, sorry to say, since it must be closed before anything else can happen with another form ... perhaps change it to a procedure in a standard module?
ASKER
@crystal (strive4peace)
Again thanks. I'll see what I can post (company security being an issue). As for your comment that forms and subforms can't call other forms and subforms may be an issue I have prepared for that circumstance and began coding around the issue but wanted to stay with the current company standards. But if not possible I will go that way.
As for my other question, can you point me to ANY link that explains the subcontent, subsection etc coding documentation? I can't find it anywhere!
Thanks again !
Again thanks. I'll see what I can post (company security being an issue). As for your comment that forms and subforms can't call other forms and subforms may be an issue I have prepared for that circumstance and began coding around the issue but wanted to stay with the current company standards. But if not possible I will go that way.
As for my other question, can you point me to ANY link that explains the subcontent, subsection etc coding documentation? I can't find it anywhere!
Thanks again !
you're welcome, Chuck
>> can you point me to ANY link that explains ... <<
try this:
Access Basics
http://www.AccessMVP.com/strive4peace
Free 100-page book that covers essentials in Access
>> can you point me to ANY link that explains ... <<
try this:
Access Basics
http://www.AccessMVP.com/strive4peace
Free 100-page book that covers essentials in Access
ASKER
@crystal (strive4peace)
Thanks again.
No where does it show subcontent or subsection ! I'm not sure why this is so difficult to find on the web or in any access documentation!
Or what order to call the Froms, subcontent, subsection etc. Very frustrating !
Thanks again.
No where does it show subcontent or subsection ! I'm not sure why this is so difficult to find on the web or in any access documentation!
Or what order to call the Froms, subcontent, subsection etc. Very frustrating !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for you help. You didn't directly answer my question but sure help me understand how the subforms work (even though I can't find documentation on it.)
My final solution was
Forms!frmMain!subContent!s ubSection! subQuality Informatio n.Form!sub RecoveryIn formation. Form.Updat eRecoveryD etails
I followed it through the debugger and it all works out.
Thanks again.
My final solution was
Forms!frmMain!subContent!s
I followed it through the debugger and it all works out.
Thanks again.
Open in new window
you can also use a relative reference with Me and Parent