Results 1 to 5 of 5
  1. #1
    Join Date
    May 2010

    Unanswered: Subform Question


    1. Can I add an unbound text field to a bound subform?
    If I can, I would like to populate the unbound text field of the subform with a value that is dependent upon a value contained in a bound field on the same subform.

    2. I would also like to dynamically populate the subform based on a users selection.

    Is this possible?

    Thank you for your help!

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Answers to # 1 is sure, but it really depends on what type of form you're talking about, Datasheet, Continuous or Single View, and exactly what you're trying to show in this textbox. Is the data related to all records in the recordset or does it reflect something particular to a given record. We need more info to help you.

    Question # 2 really needs more explanation! In a normal Main Form/Subform scenario, which involves a One (Main form) to Many (sunform) relationship, the subform data is automatically set by the selection of a record in the main form.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2010

    Subform Question - again....

    Linq, Thank you for your help.

    I have attached a partial screenshot, that will give some insight of what I am trying to accomplish.

    The subform is a Datasheet and the Main/subform is actually a one-to-one relationship (parent table only). I want the user to be able to enter selection criteria (using the fields at the top of the form) and the subform is then populated, once the user clicks the VIEW button.

    Can I accomplish using a subform?

    The other issue:

    The subform currently displays the datasheet format, which is cool (and I prefer the). But there are three columns on the subform that have to display it's textual values for user purposes.

    1. clientid is stored in the database numerically, instead of displaying the client id number,I want to display its textual value (i.e. clientid stored as 2312, is actually "New York Times")

    2. mail_days stored in the database numerically, I want to display the textual value (i.e. mail_days stored as 12, its textual value is "Sunday", "Monday")

    3. download_days same as mail_days

    Hence, the question of adding unbound columns and then wanting to populate the unbound text field of the subform with a value that is dependent upon a value contained in a bound field on the same subform.

    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2009
    Here is something I use that looks like what you want to accomplish...

    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[DestinationField] = " & Str(Nz(Me![EntryField], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    Simply replace [DestinationField] with the bound field that will contain the primary key or other record-unique field, and replace [EntryField] with the field you want to type into to generate this info.

    Hope this helps.

  5. #5
    Join Date
    May 2010
    Thank you chris07tibgs. I will try your code.

Posting Permissions

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