Link to home
Start Free TrialLog in
Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America

asked on

Subform not displaying data correctly

I have a subform based on a query that displays correctly when I open just the a form, however, When I attach the subform to the Mainform, those fields that are combos does not display the data correctly.

The Mainform is unbound and has no child/parent links.

What is causing the data not to be displayed when I place within the Mainform?  Having one of my brain freezes again.  Under an extreme deadline to fix this issue.

My original database corrupted and I had to recreate some of the forms.

thanks,

Karen
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Can you post the control source for the combo box?
Avatar of Karen Schaefer

ASKER

the control source or the row source

Here is the row source

SELECT tblOrgListing_lkup.OrgCtr, tblOrgListing_lkup.ManagerID, [LastName] & ", " & [FirstName] AS ManagerName, tblOrgListing_lkup.Org, tblOrgListing_lkup.UnitChief FROM tblOrgListing_lkup INNER JOIN tblEmployee ON tblOrgListing_lkup.ManagerID = tblEmployee.BEMS WHERE (((tblOrgListing_lkup.DoNotUse)=0)) ORDER BY [LastName] & ", " & [FirstName];

Here is the query behind the subform
SELECT tblCEDPublic_Temp.BEMSID, tblEmployee.LastName, tblEmployee.FirstName, tblEmployee.Mgr_OrgNo, BName(IIf(IsNull([REPORTS_TO_ID]),[Sponsor],[REPORTS_TO_ID])) AS MgrBEMS, IIf(Not IsNull([sponsor]),"X","") AS ContractLabor, tblCEDPublic_Temp.dept AS Insite_Dept, tblOrgListing_lkup.Org AS Current_Org, IIf(IsNull([org]) Or IsNull([Dept]) Or [Dept]<>[Org],"X","") AS OrgChanged, tblCEDPublic_Temp.BUILDING AS Insite_BldgNo, tblCEDPublic_Temp.STATUS, tblCEDPublic_Temp.STATUS_DATE, tblEmployee.StatCtr, IIf([Status]="H" Or ([status]="L"),"X","") AS Remove_Active, tblEmployee.LOA_StartDate, tblEmployee.LOA_EndDate, tblEmployee.XfrIn, tblEmployee.ServiceDt, tblEmployee.XfrOut, tblEmployee.Bldg_Primary AS Current_Bldg, IIf(IsNull([BUILDING]) Or IsNull([tblEmployee].[Bldg_Primary]),"X",IIf(Left([tblEmployee].[Bldg_Primary],Len([tblEmployee].[Bldg_Primary])-2)=[BUILDING],"","X")) AS Bldg_Chng, tblCEDPublic_Temp.ROOM AS Insite_Loc, tblEmployee.Col_Cub_Primary AS Current_Loc, IIf(IsNull([tblEmployee].[Col_Cub_Primary]) Or IsNull([room]) Or [room]<>[tblEmployee].[Col_Cub_Primary],"X","") AS Location_Chg, tblEmployee.Active, tblCEDPublic_Temp.FFMS AS Insite_MS, tblEmployee.MailStop AS Current_MS, IIf(IsNull([tblEmployee].[MailStop]) Or IsNull([FFMS]) Or [FFMS]<>[tblEmployee].[MailStop],"X","") AS MS_Chg, tblEmployee.NT_UserId, Date() AS LastEditDate, GetUserName() AS ModifiedBy
FROM ((tblEmployee LEFT JOIN tblOrgListing_lkup ON tblEmployee.Mgr_OrgNo = tblOrgListing_lkup.OrgCtr) INNER JOIN tblCEDPublic_Temp ON tblEmployee.BEMS = tblCEDPublic_Temp.BEMSID) LEFT JOIN tblEmpStatus_lkup ON tblEmployee.StatCtr = tblEmpStatus_lkup.StatCtr
WHERE (((IIf(IsNull([org]) Or IsNull([Dept]) Or [Dept]<>[Org],"X",""))="x") AND ((tblEmployee.Active)=-1)) OR (((IIf(IsNull([BUILDING]) Or IsNull([tblEmployee].[Bldg_Primary]),"X",IIf(Left([tblEmployee].[Bldg_Primary],Len([tblEmployee].[Bldg_Primary])-2)=[BUILDING],"","X")))="x")) OR (((IIf(IsNull([tblEmployee].[Col_Cub_Primary]) Or IsNull([room]) Or [room]<>[tblEmployee].[Col_Cub_Primary],"X",""))="x")) OR (((IIf(IsNull([tblEmployee].[MailStop]) Or IsNull([FFMS]) Or [FFMS]<>[tblEmployee].[MailStop],"X",""))="X"));

Open in new window


See attached for pictureUser generated image of issue
You're right, I meant RowSource.  However, I also misunderstood when you mentioned combo.  I thought you meant  a combo box on the form.  It looks like you are referring to a datasheet with fields that are LookUp fields in the table itself.  That being the case, I'm not going to be of much help.  Let's see if another expert can give you assistance.
<<I have a subform based on a query that displays correctly when I open just the a form, however, When I attach the subform to the Mainform, those fields that are combos does not display the data correctly.>>

  Is this a continious sub-form?  If yes, then you need to make sure that all the controls are bound.  If they are not, they will not display the correct data (they will be the same for every row).

Jim.
ASKER CERTIFIED SOLUTION
Avatar of Karen Schaefer
Karen Schaefer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
see last comment - found solution elsewhere