Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    6

    Unanswered: Replicating a split form in in a subform

    Hi everybody,

    I have been working on a subform, which I would like to have behave exactly the same as a split form.

    At this stage I believe that split forms are not permitted in subforms so I have been trying to replicate the split form by adding two sub forms to the main form the first a single form for the data entry pannel and the second a data sheet form for the data sheet pannel.

    This works fine except when I select a record from the data sheet subform I want the data entry form to display this record.

    I have tried to change the recordset for the data entry form on double click of the data sheet form but get an error message saying that it is not possible for this object??

    I looked a little closer and it appears that the Recordset property doesn't exist for the data entry form?

    Can you suggest any other way that I can load the selected record from the data sheet form into the data entry form?

    Thanks

    Flip

  2. #2
    Join Date
    Apr 2012
    Posts
    28
    You can display the selected record from a subform thru the Control Source in your textbox like this one:

    =[subformName].[Form]![CLIENT_NAME]

    change the [CLIENT_NAME] to the name of the field in your subform which you want to be displayed.

  3. #3
    Join Date
    Apr 2012
    Posts
    6
    Sorry ieuan,

    I'm a complete nube with Access and VBA.

    I'm not sure what you mean.

    What I'm trying to do is, on double clicking the record of interrest from the data sheet sub form the same record is loaded into the data entry subform, ready for editing.

    Can you provide more explainantion on what you have suggested please?

    Thanks

    Flip

  4. #4
    Join Date
    Apr 2012
    Posts
    28
    Quote Originally Posted by Flip74 View Post
    Sorry ieuan,

    I'm a complete nube with Access and VBA.

    I'm not sure what you mean.

    What I'm trying to do is, on double clicking the record of interrest from the data sheet sub form the same record is loaded into the data entry subform, ready for editing.

    Can you provide more explainantion on what you have suggested please?

    Thanks

    Flip
    The code I posted displays the record of the current record selected in the datasheet subform, which behaves like a split form just like what you have mentioned. Now, if the "record of interest from the datasheet subform" needs to be double-clicked, forget the previous code and try this one.

    Assuming the you have a bunch of textboxes in your data entry from, you need to reference these textboxes correctly.

    e.g.

    Private Sub Form_DblClick(Cancel As Integer)
    Forms![formname]![subDataEntry].[Form].txtLoadHere = Forms![formname]![subDatasheetSubform].[Form]![FIELD_NAME]
    End Sub

    You may need this one on how to reference subforms and controls.

    Forms: Refer to Form and Subform properties and controls

Posting Permissions

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