Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Popup References (MSACCESS 2003)

    I have a popup form which has a close button in the footer, however I want it to close when the subform closes (Subform1)
    I started by trying to reference the form by:

    Forms!Mainform1!Subform1!ClipsList.SetFocus
    Forms!Mainform1!Subform1,Form.ClipsList.SetFocus

    But both fail saying it cannot find the field Cliplist

    Next I need to be able to select a row from the popup (Popup contains a continuos form) to get the ID2 value of the record to set the recordsset of the subform.
    At the moment the recordset is selected by a listbox which I am trying to get rid of. Its event is:

    Set RS2 = Me.RecordsetClone
    RS2.FindFirst "[ID2] = " & Me![list]
    Me.Bookmark = RS2.Bookmark

    Set RS2 = Nothing

    Be glad to kiss the listbox goodbye, thanks

  2. #2
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Popup References (MSACCESS 2003)

    i have now put a command button on the continuos form in my popup. I have set is caption in the oncurrent event to be the value of ID2.
    I have a label on the subform, and have managed to fill its label with the ID2 value of the command buttons caption (OnClick) However I am now stuck as to setting the subforms (Subform1) recordset from the popup control button.

    My old Bookmark code is in the previos post. Regards

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

    Re: Popup References (MSACCESS 2003)

    It's not clear what you want to set the record source of the subform to, and why. Normally, the record source of a subform is filtered automatically by means of the Link Master Fields and Link Child Fields properties.

  4. #4
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Popup References (MSACCESS 2003)

    Hi Hans. I have a mainform bound to a Parent table, on which there is a subform bound to a Child table. On the subform was a listbox that was filled with all the related child records. Clicking on the litbox set the recordsource of the subform to that record. The tables are in a one to many. I am trying to use a continuos form in a popup to replace what the listbox was doing. The listbox set the recordset to the record having the value of ID2 (Primary key)

    Hi Hans. I have a mainform bound to a Parent table, on which there is a subform bound to a Child table. On the subform was a listbox that was filled with all the related child records. Clicking on the litbox set the recordsource of the subform to that record. The tables are in a one to many. I am trying to use a continuos form in a popup to replace what the listbox was doing. The listbox set the recordset to the record having the value of ID2 (Primary key)

    I tried this code in the popup form command button after establishing the ID2 value of the record picked.

    Set RS2 = Me.RecordsetClone
    RS2.FindFirst "[ID2] = " & Me![ID2]
    Me.Bookmark =RS2.Bookmark
    Forms!Main!Sub.Form.Bookmark = Me.Bookmark

    However if it fails on the last line saying incorrect not a valid bookmark, error 3159.

    Hope it makes things clearer, regards

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

    Re: Popup References (MSACCESS 2003)

    I still don't understand. RS2 is the recordset of the main form, and you use this to find a record in the main form.
    The subform should automatically display the related records because it's linked to the main form.
    You cannot set the bookmark of a subform to that of the main form, that makes no sense.

  6. #6
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Popup References (MSACCESS 2003)

    Thanks Hans. So I cannot replace the listbox on the subform which set the recordset of the subform by value of ID2 with something on a popup form that selects a value of ID2. So I am stuck with the existing listbox. . Thanks for your help. Best regards

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

    Re: Popup References (MSACCESS 2003)

    I'm sure something can be done but I simply don't understand what you're doing, sorry.

Posting Permissions

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