W
Wendymel
OK, I have posted on this site many times and all of you have been a huge
help! I am at the
end of my rope with this particular database. I REALLY need some help for
what I am hoping is
the last time. Hopefully, some day I will know enough to "pay it forward".
Please keep in
mind that I am not a seasoned pro at this! Thanks!
Here goes....
I have a database that contains information concerning capital projects.
I have a main table named tblProjectData that contains all the data for each
record. I have
several other tables containing lists of specific data (tblProjManager,
tblLocation,
tblBudgetYear, tblProjStatus etc.). All of the data specific tables are
joined to the main
table using one-to-many relationships.
I have a form in the db named frmProjectList. It contains a sub form named
frmSubProjectList.
The sub form is located in the forms Detail section.
The form has no record source. The form header contains 7 unbound combo
boxes, an unbound text
box, and 6 command buttons. The command buttons are not an issue at all, I
just mentioned them
for informational purposes.
I put the combo boxes in form to allow a user to filter through the records
contained in the
sub form. Each combo box is basically the same so for the sake of
arguement, I will use one
called cboProjectManagerChoice. It is designed to filter through the
project managers names in
the subform and filter out the users choice. Some of the properties of this
combo box are:
Row Source Type = table/query
Row Source = SELECT [ProjManagerName] FROM tblProjManager ORDER BY
[ProjManagerName];
After Update Event Procedure:
Private Sub cboProjectManagerChoice_AfterUpdate()
Me.frmSubProjectList.Requery
End Sub
On Change Event Procedure:
Private Sub cboProjectManagerChoice_Change()
DoCmd.Requery "frmSubProjectList"
End Sub
Now for the subform. It has a record source query named qryProjects. It is
a continuous form.
It has column headers in the form header section that are designed to sort
ascending and
descending on click or double click. The records are displayed in the
subforms detail section.
So continuing with the project manager example, there is a column for that
information. The
designated field has the following properties:
Name = ProjectManager
Control Source = ProjManagerName (this is from the main table tblProjectData)
Now for the subform record source query. Again, the query name is
qryProjects. It is designed
to pull all the information needed to populate the subform and it does that
successfully. This
is the query:
SELECT tblProjectData.ProjectUNID, tblProjectData.PROJDescription,
tblProjectData.PROJBudget,
tblProjectData.CurrentProjAuth, tblProjectData.ProjectNumber,
tblProjectNumber.ProjectNumber,
tblProjectData.PROJBudgetYear, tblBudgetYear.BudgetYear,
tblProjectData.PROJLocation,
tblLocation.Location, tblProjectData.ProjectStatus,
tblProjStatus.ProjectStatusName,
tblProjectData.PROJFundingType, tblFundingType.FundingSourceType,
tblProjectData.PROJAssignedPriority,
tblAssignedPriority.AssignedPriorityDetail,
tblProjectData.ProjectManager, tblProjManager.ProjManagerName
FROM tblFundingType RIGHT JOIN (tblBudgetYear RIGHT JOIN (tblProjectNumber
RIGHT JOIN
(tblAssignedPriority RIGHT JOIN (tblProjStatus RIGHT JOIN (tblProjManager
RIGHT JOIN
(tblLocation RIGHT JOIN tblProjectData ON tblLocation.Location =
tblProjectData.PROJLocation)
ON tblProjManager.ProjManagerName = tblProjectData.ProjectManager) ON
tblProjStatus.ProjectStatusName = tblProjectData.ProjectStatus) ON
tblAssignedPriority.AssignedPriority = tblProjectData.PROJAssignedPriority)
ON
tblProjectNumber.ProjectNumber = tblProjectData.ProjectNumber) ON
tblBudgetYear.BudgetYear =
tblProjectData.PROJBudgetYear) ON tblFundingType.FundingSourceType =
tblProjectData.PROJFundingType
WHERE (((tblProjectData.PROJDescription) Like "*" & [Forms]![frmProjectList]!
[DescriptionSearch] & "*") AND ((tblProjectNumber.ProjectNumber) Like "*" &
[Forms]!
[frmProjectList]![cboProjectNumberChoice] & "*") AND
((tblBudgetYear.BudgetYear) Like "*" &
[Forms]![frmProjectList]![cboBudgetYearChoice] & "*") AND
((tblLocation.Location) Like "*" &
[Forms]![frmProjectList]![cboLocationChoice] & "*") AND
((tblProjStatus.ProjectStatusName) Like
"*" & [Forms]![frmProjectList]![cboStatusChoice] & "*") AND
((tblFundingType.FundingSourceType)
Like "*" & [Forms]![frmProjectList]![cboFundingChoice] & "*") AND
((tblAssignedPriority.AssignedPriorityDetail) Like "*" &
[Forms]![frmProjectList]!
[cboAssignedPriorityChoice] & "*") AND ((tblProjManager.ProjManagerName)
Like "*" & [Forms]!
[frmProjectList]![cboProjectManagerChoice] & "*")) OR
((([Forms]![frmProjectList]!
[DescriptionSearch]) Is Null) AND
(([Forms]![frmProjectList]![cboProjectNumberChoice]) Is Null)
AND (([Forms]![frmProjectList]![cboBudgetYearChoice]) Is Null) AND
(([Forms]![frmProjectList]!
[cboLocationChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboStatusChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboFundingChoice]) Is Null) AND
(([Forms]![frmProjectList]!
[cboAssignedPriorityChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboProjectManagerChoice])
Is Null))
ORDER BY tblProjectData.ProjectNumber;
Now for my problem, the filters do not work properly. If a user selects a
value from any of
the combo boxes individually, they should see the list in the subform reduce
to just the
records containing the selected value. They should be able to further
filter their selection
by using any combination of combo boxes they wish. I have made this work
for 3 other databases
I have designed using all the same logic in the above query and all of the
same properties in
the tables, combo boxes etc. It just wont work for this db.
I have not been able to find a common denominator. The only thing unique to
this db from all
the others is that I was asked to design it so that the users could enter
data in a record and
leave some of the fields blank, then potentially go back later and fill in
the fields with data
once it is known to them. Thus, no validation rules are set, required is
set to NO and allow
zero length is set to yes in all the fields in all the tables. In the data
entry form, the
user enters data from combo boxes and tabs to the next field and does the
same.
Back to the frmProjectList and the project manager example; If a user
selects a project
managers name from the drop down list of the combo box on the form, they
should see the list in
the subform reduce from 300 plus records, down to the number of records that
contain the name
of the selected project manager in the project managers field. This happens,
but it always
shows the incorrect amount of records. For example, if the user selects
R.Johnson from the
combo box, they should see all 13 of the records containing his name in the
project managers
field. Instead, it only filters to 5. I can not find a common denominator
in the missing
records. Some of them are incomplete records, some of them are complete.
They all have
different values in each of the other fields so I am completely stumped.
Some of the things I have looked at:
Possible blank vs null values in fields
When I queried for nulls in the main table, it showed the blank fields so I
am assuming
all the blank fields are null, not ''.
I have torn the query apart and rebuilt it MANY TIMES.....no luck.
I have removed all but 2 of the combo boxes and rewrote the query to
accomodate this, no luck.
I have tried some visual basic to make this work and it was a disaster, I am
not good at visual
basic.
I even tried to rebuild the database from scratch...no luck.
Bottom line is....I need help. I have no idea what is wrong and have
exhausted my resources
and knowledge. Please let me know if I can add any information to this
rather exhaustive
explaination.
Thank you so much in advance!!!!
Wendy
help! I am at the
end of my rope with this particular database. I REALLY need some help for
what I am hoping is
the last time. Hopefully, some day I will know enough to "pay it forward".
Please keep in
mind that I am not a seasoned pro at this! Thanks!
Here goes....
I have a database that contains information concerning capital projects.
I have a main table named tblProjectData that contains all the data for each
record. I have
several other tables containing lists of specific data (tblProjManager,
tblLocation,
tblBudgetYear, tblProjStatus etc.). All of the data specific tables are
joined to the main
table using one-to-many relationships.
I have a form in the db named frmProjectList. It contains a sub form named
frmSubProjectList.
The sub form is located in the forms Detail section.
The form has no record source. The form header contains 7 unbound combo
boxes, an unbound text
box, and 6 command buttons. The command buttons are not an issue at all, I
just mentioned them
for informational purposes.
I put the combo boxes in form to allow a user to filter through the records
contained in the
sub form. Each combo box is basically the same so for the sake of
arguement, I will use one
called cboProjectManagerChoice. It is designed to filter through the
project managers names in
the subform and filter out the users choice. Some of the properties of this
combo box are:
Row Source Type = table/query
Row Source = SELECT [ProjManagerName] FROM tblProjManager ORDER BY
[ProjManagerName];
After Update Event Procedure:
Private Sub cboProjectManagerChoice_AfterUpdate()
Me.frmSubProjectList.Requery
End Sub
On Change Event Procedure:
Private Sub cboProjectManagerChoice_Change()
DoCmd.Requery "frmSubProjectList"
End Sub
Now for the subform. It has a record source query named qryProjects. It is
a continuous form.
It has column headers in the form header section that are designed to sort
ascending and
descending on click or double click. The records are displayed in the
subforms detail section.
So continuing with the project manager example, there is a column for that
information. The
designated field has the following properties:
Name = ProjectManager
Control Source = ProjManagerName (this is from the main table tblProjectData)
Now for the subform record source query. Again, the query name is
qryProjects. It is designed
to pull all the information needed to populate the subform and it does that
successfully. This
is the query:
SELECT tblProjectData.ProjectUNID, tblProjectData.PROJDescription,
tblProjectData.PROJBudget,
tblProjectData.CurrentProjAuth, tblProjectData.ProjectNumber,
tblProjectNumber.ProjectNumber,
tblProjectData.PROJBudgetYear, tblBudgetYear.BudgetYear,
tblProjectData.PROJLocation,
tblLocation.Location, tblProjectData.ProjectStatus,
tblProjStatus.ProjectStatusName,
tblProjectData.PROJFundingType, tblFundingType.FundingSourceType,
tblProjectData.PROJAssignedPriority,
tblAssignedPriority.AssignedPriorityDetail,
tblProjectData.ProjectManager, tblProjManager.ProjManagerName
FROM tblFundingType RIGHT JOIN (tblBudgetYear RIGHT JOIN (tblProjectNumber
RIGHT JOIN
(tblAssignedPriority RIGHT JOIN (tblProjStatus RIGHT JOIN (tblProjManager
RIGHT JOIN
(tblLocation RIGHT JOIN tblProjectData ON tblLocation.Location =
tblProjectData.PROJLocation)
ON tblProjManager.ProjManagerName = tblProjectData.ProjectManager) ON
tblProjStatus.ProjectStatusName = tblProjectData.ProjectStatus) ON
tblAssignedPriority.AssignedPriority = tblProjectData.PROJAssignedPriority)
ON
tblProjectNumber.ProjectNumber = tblProjectData.ProjectNumber) ON
tblBudgetYear.BudgetYear =
tblProjectData.PROJBudgetYear) ON tblFundingType.FundingSourceType =
tblProjectData.PROJFundingType
WHERE (((tblProjectData.PROJDescription) Like "*" & [Forms]![frmProjectList]!
[DescriptionSearch] & "*") AND ((tblProjectNumber.ProjectNumber) Like "*" &
[Forms]!
[frmProjectList]![cboProjectNumberChoice] & "*") AND
((tblBudgetYear.BudgetYear) Like "*" &
[Forms]![frmProjectList]![cboBudgetYearChoice] & "*") AND
((tblLocation.Location) Like "*" &
[Forms]![frmProjectList]![cboLocationChoice] & "*") AND
((tblProjStatus.ProjectStatusName) Like
"*" & [Forms]![frmProjectList]![cboStatusChoice] & "*") AND
((tblFundingType.FundingSourceType)
Like "*" & [Forms]![frmProjectList]![cboFundingChoice] & "*") AND
((tblAssignedPriority.AssignedPriorityDetail) Like "*" &
[Forms]![frmProjectList]!
[cboAssignedPriorityChoice] & "*") AND ((tblProjManager.ProjManagerName)
Like "*" & [Forms]!
[frmProjectList]![cboProjectManagerChoice] & "*")) OR
((([Forms]![frmProjectList]!
[DescriptionSearch]) Is Null) AND
(([Forms]![frmProjectList]![cboProjectNumberChoice]) Is Null)
AND (([Forms]![frmProjectList]![cboBudgetYearChoice]) Is Null) AND
(([Forms]![frmProjectList]!
[cboLocationChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboStatusChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboFundingChoice]) Is Null) AND
(([Forms]![frmProjectList]!
[cboAssignedPriorityChoice]) Is Null) AND
(([Forms]![frmProjectList]![cboProjectManagerChoice])
Is Null))
ORDER BY tblProjectData.ProjectNumber;
Now for my problem, the filters do not work properly. If a user selects a
value from any of
the combo boxes individually, they should see the list in the subform reduce
to just the
records containing the selected value. They should be able to further
filter their selection
by using any combination of combo boxes they wish. I have made this work
for 3 other databases
I have designed using all the same logic in the above query and all of the
same properties in
the tables, combo boxes etc. It just wont work for this db.
I have not been able to find a common denominator. The only thing unique to
this db from all
the others is that I was asked to design it so that the users could enter
data in a record and
leave some of the fields blank, then potentially go back later and fill in
the fields with data
once it is known to them. Thus, no validation rules are set, required is
set to NO and allow
zero length is set to yes in all the fields in all the tables. In the data
entry form, the
user enters data from combo boxes and tabs to the next field and does the
same.
Back to the frmProjectList and the project manager example; If a user
selects a project
managers name from the drop down list of the combo box on the form, they
should see the list in
the subform reduce from 300 plus records, down to the number of records that
contain the name
of the selected project manager in the project managers field. This happens,
but it always
shows the incorrect amount of records. For example, if the user selects
R.Johnson from the
combo box, they should see all 13 of the records containing his name in the
project managers
field. Instead, it only filters to 5. I can not find a common denominator
in the missing
records. Some of them are incomplete records, some of them are complete.
They all have
different values in each of the other fields so I am completely stumped.
Some of the things I have looked at:
Possible blank vs null values in fields
When I queried for nulls in the main table, it showed the blank fields so I
am assuming
all the blank fields are null, not ''.
I have torn the query apart and rebuilt it MANY TIMES.....no luck.
I have removed all but 2 of the combo boxes and rewrote the query to
accomodate this, no luck.
I have tried some visual basic to make this work and it was a disaster, I am
not good at visual
basic.
I even tried to rebuild the database from scratch...no luck.
Bottom line is....I need help. I have no idea what is wrong and have
exhausted my resources
and knowledge. Please let me know if I can add any information to this
rather exhaustive
explaination.
Thank you so much in advance!!!!
Wendy