• Report Issue (2003)

    • This topic has 9 replies, 3 voices, and was last updated 19 years ago.
    Author
    Topic
    #429928

    Hi,

    I have a employee table have name and phone nubmer and I have an input menu that user can select employee and other information. After user complete form, user will click report. All information that users enter will be on the report. But how can phone number shows on the report since user already select employee? I use list box for selection of employee. But how user select employee then phone number show up on the report at the same time.

    Thanks

    Viewing 0 reply threads
    Author
    Replies
    • #1002504

      I’m confused by your question. I assume that your report is based on the same table as your form, so you should be able to put a text box bound to the phone number field in the detail section of the report.

      • #1002531

        Hi,

        On the form, I only have employee. But I want the phone number show on my report with employee name.

        Thanks

        • #1002532

          That shou;dn’t be a problem. You stated that the table contains both employee name and phone number. The table is the record source of the report, so both employee name and phone number will be available for use in the report.

          • #1002534

            Hi,

            Sorry for unclear information. Yes, table have employee and phone number. But the source of the report is from the form. And there’s only employee list box on the form.

            Regards

            • #1002538

              What do you mean by “the source of the report is from the form”?

            • #1002539

              Form is the source of the report instead of table.

              Regards

            • #1002543

              Set the record source of the form to the name of the table.
              Add a text box bound to the employee name field to the detail section (i.e. its control source is the name of the employee field)
              Add a text box bound to the phone number field to the detail section.
              Save and close the report.

              I assume that you have a command button on the form to open the report. It uses a line in its On Click event procedure looking like

              DoCmd.OpenReport “rptEmployee”, acViewPreview

              for this. Change this line to look like this:

              DoCmd.OpenReport “rptEmployee”, acViewPreview, , “[EmployeeName] = ” & Chr(34) & Me.lstEmployees & Chr(34)

              Substitute the correct names.

            • #1002542

              If I’m understanding you correctly, try using DLookup in the control source for the text box to display the phone number…

              For example:
              =”Employee Phone Number: ” & DLookUp(“[ YourEmployeeNameField ]”,” YourEmployeeTableName “,”[YourEmployeeNameField ]='” & [Forms]![ YourFormName ]![ YourListboxControlName ] & “‘”)

              This would display on your report as something like this:
              “Employee Phone Number: 555-123-4567”

              Hope this helps…
              _______________________________________________________

              I have a situation just like this… The report creates posting journals and although the record source for the report itself is a query… However, there is one text box control on the report that changes every time (displaying who the journals are for this time… name and phone number)… The user opens a form first, picks a name from a combo box (tied to another table listing operators) and on the AfterUpdate event of the combobox, I open the report and the text box is populated using something very similar to my example… My text box needs to display something like this: “Operator Name: Jane Doe 2-3456”

            • #1002575

              Thanks a lot.

              Regards

    Viewing 0 reply threads
    Reply To: Report Issue (2003)

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

    Your information: