Consulting

Results 1 to 3 of 3

Thread: Solved: CurrentRecord Question

  1. #1

    Solved: CurrentRecord Question

    Hello Again Everyone,

    On one of my subforms, I have a control, I'll call Control A, that I would like to have filled automatically if the user chooses a specific option from another combobox on the same subform. However, I would like Control A's value to equal the record number of the Main form.

    So, from the subform, how do I access the Main form's record number to be able to assign it to my Control?

    I tried using the
    [VBA]Me.CurrentRecord[/VBA] from the Main form to assign the value, but it would be better if I can perform the operation from the Subform when needed.

    Thank you,

    Jerry

  2. #2
    VBAX Regular jadedata's Avatar
    Joined
    May 2004
    Location
    Eastport, Maine
    Posts
    13
    Location
    Use the AfterUpdate Event of the combobox to drive the action

    [VBA]
    Public Sub cboSomethingOrOther_AfterUpdate
    if me.cboSomethingOrOther="This" then
    me.parent.txtControlA = "Something"
    else
    me.parent.txtControlA = "Other"
    end if
    [/VBA]

    in this phrase "me." is the subform referring to itself
    "me.parent." is the subform referring to its daddy (the main form)

    There are a few other ways to do this also but this is the most direct
    -j-

  3. #3
    THANK YOU!!! Gotta Love this place!

Posting Permissions

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