Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    11

    Unanswered: Report, how to show DESC rather than ID

    I've got a simple table "A" and form. One field has a combobox control. The values in the CB come from another table. The other table "B" just has an ID field and DESC field.

    What's the easiest way to have my report show the DESC from table "B" rather than the ID?

  2. #2
    Join Date
    Feb 2005
    Posts
    11
    Restated,

    tblCustomer
    custID
    name
    address
    learnAbout


    tblLearn
    learnID
    learnDesc


    On the data entry form there is a combobox with data coming from tblLearn. The value saved in tblCustomer is learnID.

    How can I get the tblCustomer report to show me the learnDesc instead of learnID? DLookup?

  3. #3
    Join Date
    Aug 2004
    Posts
    8
    Go into design view.
    Double Click on your field to open the properties window.
    In the properties window select the Format tab.
    Find the Column Count propery, and enter 2.
    Find the Column Width property and enter 0;1

    Because your table has the name field that you want to be visible as your second colum. We are telling the column count propery to look at the first two columns

    For example if you had the table like this.

    custID
    address
    name

    Then in the Column Count field you would enter 3, because name would be the third column in this case.

    And by entering 0;1 in the column width property, you're telling the form not to show the first column (which is custID) and show 1 inch of the second column (which is name, the one we want to see) If you had name as the third column, you would enter 0;0;1 in the column width property. One number for each column. think of it as 0 is not visible, and 1 is visible.

    Hope this made sense,
    Jovix
    Last edited by Jovix; 02-17-05 at 20:56.

  4. #4
    Join Date
    Feb 2005
    Posts
    11
    I think I understand, but it seems like you are manipulating the form rather than the report. My form works fine: the combobox has the right items, and the corresponding ID number gets saved to the customer table.

    On the report where I want it to show "Google" for instance, it shows "1".

  5. #5
    Join Date
    Dec 2004
    Posts
    277
    right but use the combobox on the report and it will show the information you want... and will print out and view like its a text box with the info in it

  6. #6
    Join Date
    Aug 2004
    Posts
    8
    It works the same way for both a report and a form.

  7. #7
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I'd base the report on a query, rather than the table.

    Select tblCustomer.CustName, tblLearn.learnDesc
    FROM tblCustomer inner join tblLearn on tblCustomer.learnID = tblLearn.LearnID
    Inspiration Through Fermentation

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Showing DESC in the report

    Not sure if this helps but couldn't you just have a text field in the report and set the source object = Forms!MyForm!MyComboBox.column(1) (the form would of course need to be open/minimized/or made invisible). Maybe I misunderstood the question.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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