Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954

    I haven't been following all this thread but have fixed your issue

    I removed the master child link between form and subform as that was preventing the subform showing all the records.
    I added code to requery the subform so the new record is shown after saving.

    Did you ever look at the emulated split form that I gave a link for in post 2.
    I ask as you are effectively creating a less fully featured version of the same thing

    testdb02.accdb
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  2. #17
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    PMFJI - But this
    It is meaningful, as it shows how many applications have been accepted.
    Is not a reason to jump through a million hoops.

    You can calculate and display this value at any given moment with a simple DCount() and probably avoid half your issues, and have a properly accurate count.
    What if you need to delete a record for some unforeseen reason, your sequential numbering goes out of the window...
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #18
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    because you're not saving the record or requerying the form. As mentioned previously, there are actions aside from closing a form that causes the record to be saved. You're doing none of them. Then when you close the form, it's only for entering data thus the prior records can't be seen.

    Code:
    Private Sub btnSaveRecord_Click()
    If Me.Dirty Then Me.Dirty = False
    Me!frmDataView.Form.Requery
    mSaved = True
    MsgBox "Changes saved!"
    
    End Sub
    I don't see the need for mSaved but left it in anyway. You SHOULD turn on 'require variable declaration' in the vb editor options. This will add Option Explicit to the top of every module and force you to declare variables, which you are not doing (at least in the posted example). If you don't, you deserve all the grief you get, as someone much smarter than me once said.

    EDIT: I must have posted without refreshing the window. Nothing there, then I work on it and voila' - 2 prior answers. I also now see that mSaved is a module level variable.

  4. #19
    sessionone is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    17
    Ridders52, THANK YOU!!!!!!! I was properly going nuts...

    I removed the master child link between form and subform as that was preventing the subform showing all the records.
    I added code to requery the subform so the new record is shown after saving.

    Did you ever look at the emulated split form that I gave a link for in post 2.
    I ask as you are effectively creating a less fully featured version of the same thing

    I read about master child links, but I thought these relate in instances when multiple tables are used. Also, I couldn't find the master/child in properties neither of the main form nor the subform. After a bit of googleing now, I know how to find them.

    I did look at the examples in your post, but I got scared of the code.... Especially for v10S. I will try harder.


    Minty,

    Thanks for your input.

    Is not a reason to jump through a million hoops.

    You can calculate and display this value at any given moment with a simple DCount() and probably avoid half your issues, and have a properly accurate count.
    What if you need to delete a record for some unforeseen reason, your sequential numbering goes out of the window...
    Good point. I am trying to change practice of entering data and searching for it. At the moment, we have a word file to which all data is entered. Then, I copy everything to excel and the excel file is used as the database. Word file has autonumber field. If you have row 250, 251, and 252, and delete row 251, row 252 becomes 251. So, I would like same functionality, but now that you mention this, deleting a record would mess up numbering for sure if I search for the highest number and add 1.


    Micron,

    Thanks.

    because you're not saving the record or requerying the form. As mentioned previously, there are actions aside from closing a form that causes the record to be saved. You're doing none of them. Then when you close the form, it's only for entering data thus the prior records can't be seen.
    Yes, I understand this, but my attempts to requery did not work...

    You SHOULD turn on 'require variable declaration' in the vb editor options. This will add Option Explicit to the top of every module and force you to declare variables, which you are not doing (at least in the posted example). If you don't, you deserve all the grief you get, as someone much smarter than me once said.
    Yes, the real db has Option Explicit on, but the testdb should have had it on as well.

    Thank you, good and patient people

  5. #20
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You're welcome.
    In most form/subform setups the master & child fields are needed to create a link between the two parts.
    However when creating a pseudo split form like yours, you can't use them as it prevents anything being shown in the subform part.

    The ESF isn't really that scary and you could just replace the example table and controls with your own.
    I did all versions up to but not including 10S. I do agree that the changes in that version would benefit from additional explanation.
    However, that user seems to have now left the AWF forum.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #21
    sessionone is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    17
    Guys,

    Thank you again for your help. I think this thread can be now closed.

    SessionOne

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 39
    Last Post: 07-28-2018, 12:27 PM
  2. Replies: 10
    Last Post: 07-05-2017, 11:31 AM
  3. Replies: 4
    Last Post: 11-06-2014, 05:35 AM
  4. Replies: 1
    Last Post: 04-14-2014, 01:38 PM
  5. Replies: 5
    Last Post: 06-18-2013, 10:40 PM

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