Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    record navigation in subforms (XP, 2000)

    I have a subform that will not let me go to different records or add records. Initially, I disabled the native Access nav buttons and created my own. when that didn't work, I enabled the access nav buttons and they don't work either. I suspect it is connected with an option group because the add record button is grayed out initially but if I select an option (the field associated with the option group is not required and the option group has no default value), then the add record button becomes active although I can't really "add" - get a blank form to enter another record. I simply have no nav controls and no feedback that I entered a record.

    When I look at the underlying table, I see the record I entered but when i go back to the form, I can't see that record either. the child and master links seem to be correct and the relationship is established.

    Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: record navigation in subforms (XP, 2000)

    Apparently, the subform starts out without existing records, so it is on a new record. Since you are already on a new record, the Add Record button is grayed out. As soon as you click something in the option group, you have created a record, and hence the Add Record button is enabled.

    If a record is created but you can't see it, there must be a problem with the link between main and subform. Probably, Access doesn't/can't fill in the linking value. You will have to provide much more detailed information, or a stripped down database, if you want us to solve that.

  3. #3
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record navigation in subforms (XP, 2000)

    Here is the sanitized DB - there may be some errors such as objects not found, etc. Open the master input form then open the tab titled line information. This is the line input form that is subordinate to the master input form. The linking field is prospectID. You will see that the line information tab also has subforms in a tab control - most of which have been removed and the field that links them to the line is the LineID.
    Attached Files Attached Files

  4. #4
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record navigation in subforms (XP, 2000)

    Edited by HansV to reduce huge screenshot in size - please don't post 1024 x 768 pixel images, they cause horizontal scrolling for many users.

    This might help - it is a picture of the relationship.
    Attached Images Attached Images

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: record navigation in subforms (XP, 2000)

    You have set the Data Entry property of the LINE_INPUT (sub)form to Yes. This means that you can only enter new records, not view existing ones. If you set Data Entry to No, you will see the existing records.

    The code in the On Current event of the subform prevents normal behavior, you should remove it.

  6. #6
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record navigation in subforms (XP, 2000)

    Thank you Hans. The code in the oncurrent event was intended to produce an accurate record count for my nav controls - would it be better as an onload event? The DB I sent you had many controls removed in order to meet the 100K requirement. but between the nav buttons, I have a text box showing record X of Y. That is why I had it go to the last record then return to the first.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: record navigation in subforms (XP, 2000)

    You certainly shouldn't put it in the On Current event, because this event occurs when the user wants to move to another record. The code that moves to the last record, then to the first, effectively makes record navigation completely impossible. As you suggest yourself, use the On Load event. This occurs only once, when the form is opened.

  8. #8
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record navigation in subforms (XP, 2000)

    Thanks again - that would explain why there seemed to be an almost endless loop as I tried to go from record to record. I am searching for book recommendations for Access - something that gets into the various properties and VBA - MS Access help does not help me much. Any recommendations?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: record navigation in subforms (XP, 2000)

    Beginning Access 2002 VBA from Wrox Press (2000 version also still available)

    The "Bible" is the 2-volume Access 2002 Developer's Handbook from Sybex (2000 version also still available). Not for casual reading, but an invaluable reference.

    Searching this forum for book recommendation will turn up more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •