Re: Display result of combo box selection on form?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MCB (MCB_at_discussions.microsoft.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 13:51:03 -0800


"Marshall Barton" wrote:

> MCB wrote:
>
> >I found an answer on another question that I think is getting me closer, but
> >I am still getting errors.
> >
> >Currently, on frmBugs, for the field CreatedBy, the user selects from names
> >displayed in a combo box (cboCreatedBy). The source of those names is: SELECT
> >[tblUsers].[UserID], [tblUsers].[User] FROM tblUsers;
> >
> >I want the name selected in CreatedBy to appear on a report, but currently I
> >can only get the UserID to show up, or get an error.
> >
> >I tried =[Forms]![frmBugs]![cboCreatedBy].Column(1) but it's returning an
> >error. None of the assorted DLookup attempts I've made work, either. Help?
>
>
> Create a query to use as the report's RecordSource. Add
> both the main table the report is currently based on AND
> table tblUsers. Drag the main table field user ID field to
> the UserID field in tblUsers. This should result in a
> connecting line between the tow table/fields. If the main
> table user ID field might not be specified, then right click
> on the line and select Join Type from the little pop up
> menu. Select the option Select all from table <main table>
> and any matching records in tblUsers.
>
> Now drag all the needed fields in the main table to the
> field list and drag the User field from tblUsers down to the
> query's field list so you can use it in the report.

I've already tried to do that. The report's RecordSource is
qryProjectsReport. The report isn't based on one main table; it's based on
three: tblProjects, tblFunctionSets, and tblBugs (the theory being a
cascading one - a project can have multiple functions sets, and each function
set can have multiple bugs). The field I was asking about (CreatedBy) is in
tblBugs. All three tables are in the query.

I have tried adding tblUsers to the query, but when I do it "breaks" (i.e.
no records show up at all). Currently there are three fields that pull their
combo box records from tblUsers (CreatedBy, Owner, and Signoff). I thought
that's what was breaking it, but I haven't been able to get it to work when I
change the relationship so it only involves one of the three, e.g.
[tblUsers].[UserID] joined to [tblBugs].[CreatedBy], but that doesn't work,
either.



Relevant Pages

  • Re: Display result of combo box selection on form?
    ... >Currently, on frmBugs, for the field CreatedBy, the user selects from names ... >I want the name selected in CreatedBy to appear on a report, ... the UserID field in tblUsers. ... Now drag all the needed fields in the main table to the ...
    (microsoft.public.access.reports)
  • Re: Display result of combo box selection on form?
    ... Drag the main table field user ID field to ... >> the UserID field in tblUsers. ... >> query's field list so you can use it in the report. ... All three tables are in the query. ...
    (microsoft.public.access.reports)
  • Re: Display result of combo box selection on form?
    ... you need 3 copies of tblUsers. ... >>>>>Currently, on frmBugs, for the field CreatedBy, the user selects from ... >>>> both the main table the report is currently based on AND ... All three tables are in the query. ...
    (microsoft.public.access.reports)