Results 1 to 10 of 10
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Issue (2003)

    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

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

    Re: Report Issue (2003)

    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.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Issue (2003)

    Hi,

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

    Thanks

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

    Re: Report Issue (2003)

    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.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Issue (2003)

    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

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

    Re: Report Issue (2003)

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

  7. #7
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Issue (2003)

    Form is the source of the report instead of table.

    Regards

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

    Re: Report Issue (2003)

    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.

  9. #9
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Issue (2003)

    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"

  10. #10
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Issue (2003)

    Thanks a lot.

    Regards

Posting Permissions

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