Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Carry unbound txtBox value toa report (Access XP)

    Rudi,
    At any time do you close the switchboard? If so, you'll have to store the value. Otherwise, you could set the value of the report header =forms!frmMAINFORM.txtTEXTBOX. I'm pretty sure you'll have to use a text box in the header, and format it to look like a label.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Carry unbound txtBox value toa report (Access XP)

    Yes...the switchboard form does close!! 8-(

    I've tried storing the txtbox value in a public variable...but I have no success yet!

    Tx for the fast reply!
    Regards,
    Rudi

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Carry unbound txtBox value to a report (Access XP)

    I have a switchboard form that contains a txtbox for someone to type a name into it! I need to carry the name typed into it onto a report. I am not sure how to do this.

    Actions happen as follows:
    The user activates the switchboard, and types a name into the txtbox
    Then they click a button to list a couple of reprts on a different form
    The user clicks a button to show another form that prompts for a start and end date (to filter the report data)
    Then they click on a button to view the report.

    Wnen the report opens, all the records display well, but how do I get the name of the txtbox on the original switchboard onto the report header.???

    TIA
    Regards,
    Rudi

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Carry unbound txtBox value toa report (Access XP)

    Define the public variable in the Functions module (or in another standard module, not in a form module):

    Public CurrUserName As String

    Use this in the function:

    Public Function Curr_UserName()
    Curr_UserName = CurrUserName
    End Function

    In the code behind the command buttons on the form, set the variable, for example

    Private Sub cmdRunReports_Click()
    ' First set global variable
    CurrUserName = Me.txtName
    ' Then open form frmReports
    DoCmd.RunMacro "MMReports"
    End Sub

  5. #5
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Carry unbound txtBox value toa report (Access XP)

    Tx a stach Hans....Its workig well now!

    It seems so simple when the answer is given!! [dazzled]
    Regards,
    Rudi

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Carry unbound txtBox value toa report (Access XP)

    Hans

    Is there a way inside the application you can see a list of global variables and there contents that were set by the programmer in a particilar session?

    Thanks, John

  7. #7
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Carry unbound txtBox value toa report (Access XP)

    Can't this be done in the Locals Window in VBA?
    Regards,
    Rudi

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Carry unbound txtBox value toa report (Access XP)

    I don't know of a way to list them, but you can view them in the Object Browser (F2)

Posting Permissions

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