Unbound controls of a form onto a report using vba/command button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mshakeelattari
    New Member
    • Nov 2014
    • 103

    Unbound controls of a form onto a report using vba/command button

    Hi,
    I have an unbound form with some unbound controls such as combo boxes or textboxes, in MS Access 2013. I have a report with the similar controls. I do open the report from the form by a command button using vba code. I want to get the data/values from the combos/textboxes's controls in the report's controls using a command button on the form. Any help please!
    Last edited by mshakeelattari; Mar 16 '15, 02:44 PM. Reason: typo
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    Probably the easiest way is to use TempVars. Use something like this from your command button on your Form to save off the value of a TextBox into a TempVar:
    Code:
    TempVars.Add "SomeValue", Me.txtBox.Value
    Then use something like this as the Control Source for a TextBox on the Report to get the value for the TempVar:
    Code:
    =[TempVars].[Item]("SomeValue")

    Comment

    Working...