Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did this a long time ago and can't locate the Access project, so thought I'd swing by the lounge...

    I have a combo box that, on select, loads all data matched by first and last name in a subform set to datasheet view. Now, I want to do things based on the user's selection of a row in the datasheet. specifically, load a single record (defined by something called the Form DLN) for further processing. basically, I want the user to specify a specific DLN via a non-specific name selection.

    TIA!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The value of a control on the subform will be the value in the currently active record.

    So in code behind the subform itself, the value of a control named txtDLN in the currently active record is Me!txtDLN.

    If you want to get at it in code behind the main form, use Me!sbfSomething!txtDLN, where sbfSomething is the name of the subform as a control on the main form.

    And if you want to retrieve the value in code that runs elsewhere (e.g. in a general module), use Forms!frmMain!sbfSomething!txtDLN, where frmMain is the name of the main form.

    (As usual, enclose a name in square brackets [ ] if it contains spaces or punctuation.)

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks! i already figured it out - may want to re-tool it as a continuous form to make the user selection even more obvious. that i've done before too...

Posting Permissions

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