Results 1 to 6 of 6
  1. #1
    awurah is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Oct 2017
    Posts
    13

    Show subform data in main form using the same table

    Hello,

    This is a question that has been asked before but for some reason when I am trying to set it up in my lease management database it does not work like I want it to.

    I have a subform (in a datasheet format) on a main form that are using the same table as a data source. All the fields in both forms match. When I click on the line in my subform datasheet, I would like the data to change in the main form to reflect what has been clicked in the main form. Essentially, the subform and the main form would act as a split form.



    I found similar threads that used this as a Current Event :

    Code:
    Private Sub Form_Current()
    Me.Parent.Filter = "BaseAnnualRent= " & Me.BaseAnnualRent
    Me.Parent.FilterOn = True
    End Sub
    
    .

    I used the BaseAnnualRent field because it it the one that is unique to in the different data entry lines. What happens when is that when I select, it does what I want it to do. The subform entry shows in the main form, but every other subform entry disappears. The subform is essentially blank save for the possibility to add an entry. I would like the subform to remain the same after clicking.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    All of the other records are "disappearing" because they do not match your new filter.

  3. #3
    awurah is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Oct 2017
    Posts
    13
    Quote Originally Posted by RuralGuy View Post
    All of the other records are "disappearing" because they do not match your new filter.
    Thank you for responding. This makes sense. How could I use VBA to make them not disappear?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  5. #5
    awurah is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Oct 2017
    Posts
    13
    Quote Originally Posted by orange View Post
    I'm not sure if this is relevant to you, but a colleague has created a sample database showing an emulated split form here.
    THANK YOU! This is exactly what I am trying to do. When I tried to use the code in my own database, the debugger said "Compile Error: Method or Data Member" not found. I believe from reading the thread that it is because it only works when both forms are not linked (which I believe my forms are) but I am not sure how to "unlink" them.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    You should review the thread that started the discussion on emulated split form for details of the structure. (Especially the info by MarkK)
    There is info in the sample database thread also that may be important.

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

Similar Threads

  1. Subform gives data to main form
    By wlanssens in forum Forms
    Replies: 8
    Last Post: 12-01-2013, 07:06 PM
  2. Replies: 8
    Last Post: 05-30-2013, 05:06 PM
  3. Replies: 11
    Last Post: 01-10-2013, 06:23 PM
  4. Subform - autofill data from main form
    By Kelly_D in forum Access
    Replies: 3
    Last Post: 03-20-2012, 11:36 AM
  5. Replies: 2
    Last Post: 03-31-2010, 01:56 PM

Tags for this Thread

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