Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2013
    Posts
    2

    Unanswered: Get Data from Unbound form and populate on Data Entry Form

    Hello,

    I hate the same ole "new to the Access world . . . " opening, so I will spare you.

    I have what seems to be a simple task. I have a small Database that tracks building data.

    I have a form that asks the user to define 2 entries first. These questions are on an Unbound Form. I would simply like to get that data and place it on the New Property form in the respective spots.

    DB is attached.

    Open frmGetPT&PU, select one item from each field.
    Click command button, that opens the next form.
    the two fields I would like to populate with your selections are:
    txtPropType
    txtPlanUse

    Simple in my mind, but after 2 days of pounding on it - I got nothing and need your help - thanks in advance for your consideration and time.
    Attached Files Attached Files

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If you want to stay with the macro, you'd use the SetValue action (may have to click on "Show all Actions" on the ribbon). In VBA, which is what I use, right after opening the second form:

    Forms!frmNewProptxtPropType = Me.cboPropType
    Paul

  3. #3
    Join Date
    Sep 2013
    Posts
    2

    Thanks Paul!!

    I appreciate your time sir - I have been dancing around this, well like I said, for a couple of days - UGH!!

    I knew it had to be something simple . . .

    So here is the resulting code, and yes, I converted the stumbling macros to VBA. - this is running on the "Continue" button

    Private Sub cmdOpenNewProp_Click()
    On Error GoTo cmdOpenNewProp_Click_Err

    PropType = Me.cboPropType
    PlanUse = Me.cboPlanUse

    DoCmd.OpenForm "frmNewProp", acNormal, "", "", acAdd, acNormal

    forms!frmNewProp!txtSaleRental = "SALE"
    forms!frmNewProp!txtPropType = PropType
    forms!frmNewProp!txtPlanUse = PlanUse

    DoCmd.Close acForm, "frmGetPT&PUSale"


    cmdOpenNewProp_Click_Exit:
    Exit Sub

    cmdOpenNewProp_Click_Err:
    MsgBox Error$
    Resume cmdOpenNewProp_Click_Exit

    End Sub

    Just a couple weird returns to clear up, but I believe they are in the Query
    THANKS AGAIN!!!

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help and welcome to the site by the way!
    Paul

Posting Permissions

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