Results 1 to 6 of 6
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434

    set recordsource of a form in a not linked split form

    Hi


    i made a split form with two not related forms:
    Click image for larger version. 

Name:	Annotazione 2020-06-18 110859.png 
Views:	14 
Size:	142.8 KB 
ID:	42218

    the one in the left called "nav" is just to open other forms, the bigger one on the right is called "candidati" and the split main form is called "lista calendario"


    in the right form "lista calendario" i used the C button to navigate to a form called "candidatiS1" that was a single form. Now i made a split form adding the same "Nav" form as you can see, and i gave the name "candidatis1" to the split form and the old "candidatis1" (the single form) now is called "candidati"

    Click image for larger version. 

Name:	can.png 
Views:	13 
Size:	52.7 KB 
ID:	42219


    this is the code i used to navigate to the single form, now i'm not able to set the recordsource of the "candidati" form in the split form "CandidatiS1"

    Code:
    Private Sub Comando494_Click()   If CurrentProject.AllForms("candidatis1").IsLoaded = True Then
          Forms!candidatis1.RecordSource = "SELECT Candidati.* FROM Candidati WHERE (((Candidati.IDcandidato)= " & Me.Candidato & "));"
          DoCmd.OpenForm "candidatis1", acNormal, , , acFormReadOnly, acWindowNormal
       Else
          DoCmd.OpenForm "candidatis1", acNormal, , , acFormReadOnly, acWindowNormal, Me.Candidato
       End If
    End Sub

  2. #2
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    274
    If you don't attach an example file, replacing any sensitive data, it will be difficult to help you.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    thanks very much, i found the solution

    if you want to set a recordsource of a form in a split form and you are in another form this is the reference method

    Code:
    Forms.SplitForm.SingleForm.Form.RecordSource
    if you want to open a split form and set the recordsource of a form in it this is the reference method to put in the "open event" of the split form

    Code:
    Me!SingleForm.Form.RecordSource
    thanks for the help, till next

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    FYI, the term "split form" refers to a specific type of form, which yours is not. That makes it a little confusing. What you have is referred to as a subform on a main form. This is a split form:

    https://support.microsoft.com/en-us/...b-86e79a1fbe1e
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    you're right. that was a translation issue, sorry.
    i just made a form composed by two unrelated forms. i thought it was called "split form" too

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Nothing to be sorry about, I just wanted to clarify the terms.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 07-05-2017, 11:31 AM
  2. Replies: 3
    Last Post: 11-03-2015, 11:19 PM
  3. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  4. Replies: 2
    Last Post: 08-14-2014, 06:49 AM
  5. Replies: 8
    Last Post: 05-10-2012, 10:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums