• Pass field value to New Record in New Form (A2k)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Pass field value to New Record in New Form (A2k)

    • This topic has 2 replies, 2 voices, and was last updated 17 years ago.
    Author
    Topic
    #450625

    Hello.

    I have created a button on Form A that opens Form B to a new record. I also need to put a value from FORM_A’s FIELD_22 into Form_B’s FIELD_99 for the new record and then refresh.

    I have tried the following and various similar guesses…. Any help would be greatly appreciated. Thanks.

    Private Sub Command13_Click()
    On Error GoTo Err_Command13_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim meetingtype As String
    meetingtype = Me.MeetingID

    stDocName = “frm_meetings_actual”
    DoCmd.OpenForm stDocName, , , , acFormAdd
    [Planned_mtg_ID] = meetingtype

    Exit_Command13_Click:
    Exit Sub

    Err_Command13_Click:
    MsgBox Err.Description
    Resume Exit_Command13_Click

    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #1107509

      Does it work if you change the line

      [Planned_mtg_ID] = meetingtype

      to

      Forms(stDocName)![Planned_mtg_ID] = meetingtype

      • #1107526

        Indeed it does work perfectly.

        Thank you very much Hans.

        Very truly yours.

        Jason

    Viewing 0 reply threads
    Reply To: Pass field value to New Record in New Form (A2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: