Hi!
I use this code on a command button to copy a text from textbox 1 in form A, to textbox 2 in form B and this works great.
and I use this code on a command button to print the report I choose from a combobox and this also works.
Is it possible to copy text from a combobox in a form to a textbox in a report and then print it? I tried using this code but it just printed the report without copying the combobox.
I use this code on a command button to copy a text from textbox 1 in form A, to textbox 2 in form B and this works great.
Code:
Private Sub CmdA_Click()
DoCmd.OpenForm "FormA", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!FormA.Text1.Value = Forms!FormB.Text2.Value
End Sub
Code:
Private Sub Cmdprint_Click()
Dim strReport As String
If Me.Combo1 = "ReportA" Then
strReport = "ReportA"
ElseIf Me.Combo1 = "B" Then
strReport = "ReportB"
Else
strReport = "ReportC"
End If
DoCmd.OpenReport strReport
End Sub
Code:
Private Sub Cmd_print_report_Click()
DoCmd.OpenReport "ReportA", acNormal
Report!ReportA.Textbox1.Value = Forms!FormA.Combo1.Value
End Sub
Last edited: