Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Outer Subform of a Continuous Form
Milan Drazen Todorovic Sasmay 
   
2 months ago
Hello everyone!

I have been trying to sync a subform to a continuous form like this class explains (from the outside with On Current event):
https://www.youtube.com/watch?v=uayJmSNJtkI

But i'm having the next problem; when the subform is put in the continuous form's footer i can keep adding rows of data to the subform because the PK and FK relation is working, it also shows the parameter to define master and child linked fields, so i just link PK and FK and can keep adding rows of data, but, when i do as the class explains and put the subform outside, it somehow the link between PK and FK breaks because i can't keep adding rows.
I'm using the code as explained in the video (i tripple checked):
Private Sub Form_Current()
    DoCmd.OpenForm "OrdenTrabajoF", , , "ID_Mantencion=" & ID_Mantencion
End Sub

But the rows to add new data doesn't say "new*" in the PK and the related ID of the FK, instead it just shows a 0 in the FK so i get error "you need a related record" (which does exists)
Milan Drazen Todorovic Sasmay OP  @Reply  
   
2 months ago
Sorry, i used all the characters;

So, i would like some help to know how to restore the link between master and child linked fields, so i can keep adding rows of data to the continuous form that's synced on the outside,

Thanks in advance!
Raymond Spornhauer  @Reply  
          
2 months ago
You need to show us your Form and the code you are using.  Just showing us the link to Rick's video is not going to give us the information we need to help you.

-Raymond
Milan Drazen Todorovic Sasmay OP  @Reply  
   
2 months ago

Donald Blackwell  @Reply  
       
2 months ago
In the form you made into a separate form is where I would put the event to set the FK value.

Private Sub Form_Current()

     If Me.NewRecord then FK = Forms("ListAMantencionF")!ID

end sub


With this, everytime you move into the new record, it will update with the currently selected record in the other form, provided it is open, otherwise, it will throw an error which you can do error handling for if necessary.

Adjust field names as appropriate.

As for the error, that is because it is no longer able to directly pull information from the secondary form so you'll need to change those sources so they point to the external form (if it's open) such as =Forms!OrdenTrabajoF!FIELDNAME

Again, replace FIELDNAME with the field you are trying to get the value of
Milan Drazen Todorovic Sasmay OP  @Reply  
   
46 days ago
Hello again, i managed to make it work, following your recomendation, for the OrdenTrabajoF i used this event:
DetailsPrivate Sub Form_BeforeInsert(Cancel As Integer)

    If Not IsNull(Forms!ListaMantencionF!ID_Mantencion) Then
        Me.ID_Mantencion = Forms!ListaMantencionF!ID_Mantencion
    Else
        Cancel = True
    End If

End Sub


And for the MantencionF i used this events:
DetailsPrivate Sub Form_Load()

    If Not CurrentProject.AllForms("InformacionEquipoF").IsLoaded Then
        DoCmd.OpenForm "InformacionEquipoF"
    End If

    If Not CurrentProject.AllForms("OrdenTrabajoF").IsLoaded Then
        DoCmd.OpenForm "OrdenTrabajoF"
    End If

    If Not CurrentProject.AllForms("IntervencionF").IsLoaded Then
        DoCmd.OpenForm "IntervencionF"
    End If

End Sub



Private Sub Form_Current()

    If Me.NewRecord Then Exit Sub

    ' -------- INFORMACION EQUIPO --------
    If Not IsNull(Me.ID_Equipo) Then
        With Forms!InformacionEquipoF
            .Filter = "ID_Equipo=" & Me.ID_Equipo
            .FilterOn = True
        End With
    Else
        Forms!InformacionEquipoF.FilterOn = False
    End If

    ' -------- ORDEN TRABAJO --------
    If Not IsNull(Me.ID_Mantencion) Then
        With Forms!OrdenTrabajoF
            .Filter = "ID_Mantencion=" & Me.ID_Mantencion
            .FilterOn = True
        End With

        ' -------- INTERVENCION --------
        With Forms!IntervencionF
            .Filter = "ID_Mantencion=" & Me.ID_Mantencion
            .FilterOn = True
        End With

    Else
        Forms!OrdenTrabajoF.FilterOn = False
        Forms!IntervencionF.FilterOn = False
    End If

End Sub


Private Sub Form_Close()
    DoCmd.Close acForm, "InformacionEquipoF", acSaveYes
    DoCmd.Close acForm, "OrdenTrabajoF", acSaveYes
    DoCmd.Close acForm, "IntervencionF", acSaveYes
End Sub



I hope this is usefull to someone!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 4:29:48 AM. PLT: 1s