How do I get my combo box to allow selection of entries?

G

Guest

I'm sure this is simple and I used to know how to do this, but I'm unable to
get a combo box on a form to allow selection of records contained in it.
And it's probably been covered somewhere in here, but I'm not seeing it. So,
to make a long question long...

I've set it as an unbound control with the row source as this query: SELECT
DISTINCT (qryReport.ROC), qryROC.ROC_Name FROM qryReport INNER JOIN qryROC ON
qryReport.ROC=qryROC.ROC_ID;

It is in a form where the source is this query: SELECT
tblSupportedCommunity.ROC, tblSupportedCommunity.Community,
qryTotalQ4Expirations.Total AS [Current Expirations Q4 2006],
qryTotalQ4Expirations.October AS [Current Expirations October],
qryTotalQ4Expirations.November AS [Current Expirations November],
qryTotalQ4Expirations.December AS [Current Expirations December],
qryRenewal.Total AS [Q4 2006 Renewals], qryRenewal.October AS [Renewals
October], qryRenewal.November AS [Renewals November], qryRenewal.December AS
[Renewals December], qryPendingRenew.Total AS [Q4 Pending Renewals],
qryPendingRenew.October AS [Pending Renewals October],
qryPendingRenew.November AS [Pending Renewals November],
qryTransfers.Transfers, qryPendingRenew.December AS [Pending Renewals
December], qryOnNotice.[On Notice] AS [Q4 2006 On Notice], IIf([MoveOuts] Is
Null,0,[MoveOuts]) AS [Q4 2006 Move Outs],
qryMoveOutsNotFullfilled.MoveOutNotFullfill AS [Q4 2006 Move Out,
Non-Fullfilled, Eviction & Skips], IIf(qryUnkExpirations!Total Is
Null,0,qryUnkExpirations!Total) AS [Q4 2006 Unknown],
qryMonth2Month.Month2Month AS [Q4 2006 MTM]
FROM (qryMonth2Month RIGHT JOIN (qryUnkExpirations RIGHT JOIN
((((((tblSupportedCommunity LEFT JOIN qryTotalQ4Expirations ON
tblSupportedCommunity.Community = qryTotalQ4Expirations.Community) LEFT JOIN
qryRenewal ON tblSupportedCommunity.Community = qryRenewal.Community) LEFT
JOIN qryPendingRenew ON tblSupportedCommunity.Community =
qryPendingRenew.Community) LEFT JOIN qryOnNotice ON
tblSupportedCommunity.Community = qryOnNotice.Community) LEFT JOIN
qryMoveOuts ON tblSupportedCommunity.Community = qryMoveOuts.Community) LEFT
JOIN qryMoveOutsNotFullfilled ON tblSupportedCommunity.Community =
qryMoveOutsNotFullfilled.Community) ON qryUnkExpirations.Community =
tblSupportedCommunity.Community) ON qryMonth2Month.Community =
tblSupportedCommunity.Community) LEFT JOIN qryTransfers ON
tblSupportedCommunity.Community = qryTransfers.Community
ORDER BY tblSupportedCommunity.ROC, tblSupportedCommunity.Community;

I've got the combo box to populate with the data I want, but it won't do
anything when I select a specific entry. I'd like to use it to update the
rest of the form.

Any help would be appreciated. Thanks ever so.
 
A

Allen Browne

Use the Afterupdate event procedure of the combo to find the record you want
in the form's RecordsetClone. After verifying you found it (not NoMatch),
you can display the found record by setting the form's Bookmark.

Explanation:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

JoAnnP said:
I'm sure this is simple and I used to know how to do this, but I'm unable
to
get a combo box on a form to allow selection of records contained in it.
And it's probably been covered somewhere in here, but I'm not seeing it.
So,
to make a long question long...

I've set it as an unbound control with the row source as this query:
SELECT
DISTINCT (qryReport.ROC), qryROC.ROC_Name FROM qryReport INNER JOIN qryROC
ON
qryReport.ROC=qryROC.ROC_ID;

It is in a form where the source is this query: SELECT
tblSupportedCommunity.ROC, tblSupportedCommunity.Community,
qryTotalQ4Expirations.Total AS [Current Expirations Q4 2006],
qryTotalQ4Expirations.October AS [Current Expirations October],
qryTotalQ4Expirations.November AS [Current Expirations November],
qryTotalQ4Expirations.December AS [Current Expirations December],
qryRenewal.Total AS [Q4 2006 Renewals], qryRenewal.October AS [Renewals
October], qryRenewal.November AS [Renewals November], qryRenewal.December
AS
[Renewals December], qryPendingRenew.Total AS [Q4 Pending Renewals],
qryPendingRenew.October AS [Pending Renewals October],
qryPendingRenew.November AS [Pending Renewals November],
qryTransfers.Transfers, qryPendingRenew.December AS [Pending Renewals
December], qryOnNotice.[On Notice] AS [Q4 2006 On Notice], IIf([MoveOuts]
Is
Null,0,[MoveOuts]) AS [Q4 2006 Move Outs],
qryMoveOutsNotFullfilled.MoveOutNotFullfill AS [Q4 2006 Move Out,
Non-Fullfilled, Eviction & Skips], IIf(qryUnkExpirations!Total Is
Null,0,qryUnkExpirations!Total) AS [Q4 2006 Unknown],
qryMonth2Month.Month2Month AS [Q4 2006 MTM]
FROM (qryMonth2Month RIGHT JOIN (qryUnkExpirations RIGHT JOIN
((((((tblSupportedCommunity LEFT JOIN qryTotalQ4Expirations ON
tblSupportedCommunity.Community = qryTotalQ4Expirations.Community) LEFT
JOIN
qryRenewal ON tblSupportedCommunity.Community = qryRenewal.Community) LEFT
JOIN qryPendingRenew ON tblSupportedCommunity.Community =
qryPendingRenew.Community) LEFT JOIN qryOnNotice ON
tblSupportedCommunity.Community = qryOnNotice.Community) LEFT JOIN
qryMoveOuts ON tblSupportedCommunity.Community = qryMoveOuts.Community)
LEFT
JOIN qryMoveOutsNotFullfilled ON tblSupportedCommunity.Community =
qryMoveOutsNotFullfilled.Community) ON qryUnkExpirations.Community =
tblSupportedCommunity.Community) ON qryMonth2Month.Community =
tblSupportedCommunity.Community) LEFT JOIN qryTransfers ON
tblSupportedCommunity.Community = qryTransfers.Community
ORDER BY tblSupportedCommunity.ROC, tblSupportedCommunity.Community;

I've got the combo box to populate with the data I want, but it won't do
anything when I select a specific entry. I'd like to use it to update the
rest of the form.

Any help would be appreciated. Thanks ever so.
 
G

Guest

Thanks Allen & Christy, but it's still not working. I tried both methods,
and the combo box will show all the available records, but when I click on
one, nothing. Does it matter that I have a subform within my form? Thanks
ever so!

JoAnnP said:
I'm sure this is simple and I used to know how to do this, but I'm unable to
get a combo box on a form to allow selection of records contained in it.
And it's probably been covered somewhere in here, but I'm not seeing it. So,
to make a long question long...

I've set it as an unbound control with the row source as this query: SELECT
DISTINCT (qryReport.ROC), qryROC.ROC_Name FROM qryReport INNER JOIN qryROC ON
qryReport.ROC=qryROC.ROC_ID;

It is in a form where the source is this query: SELECT
tblSupportedCommunity.ROC, tblSupportedCommunity.Community,
qryTotalQ4Expirations.Total AS [Current Expirations Q4 2006],
qryTotalQ4Expirations.October AS [Current Expirations October],
qryTotalQ4Expirations.November AS [Current Expirations November],
qryTotalQ4Expirations.December AS [Current Expirations December],
qryRenewal.Total AS [Q4 2006 Renewals], qryRenewal.October AS [Renewals
October], qryRenewal.November AS [Renewals November], qryRenewal.December AS
[Renewals December], qryPendingRenew.Total AS [Q4 Pending Renewals],
qryPendingRenew.October AS [Pending Renewals October],
qryPendingRenew.November AS [Pending Renewals November],
qryTransfers.Transfers, qryPendingRenew.December AS [Pending Renewals
December], qryOnNotice.[On Notice] AS [Q4 2006 On Notice], IIf([MoveOuts] Is
Null,0,[MoveOuts]) AS [Q4 2006 Move Outs],
qryMoveOutsNotFullfilled.MoveOutNotFullfill AS [Q4 2006 Move Out,
Non-Fullfilled, Eviction & Skips], IIf(qryUnkExpirations!Total Is
Null,0,qryUnkExpirations!Total) AS [Q4 2006 Unknown],
qryMonth2Month.Month2Month AS [Q4 2006 MTM]
FROM (qryMonth2Month RIGHT JOIN (qryUnkExpirations RIGHT JOIN
((((((tblSupportedCommunity LEFT JOIN qryTotalQ4Expirations ON
tblSupportedCommunity.Community = qryTotalQ4Expirations.Community) LEFT JOIN
qryRenewal ON tblSupportedCommunity.Community = qryRenewal.Community) LEFT
JOIN qryPendingRenew ON tblSupportedCommunity.Community =
qryPendingRenew.Community) LEFT JOIN qryOnNotice ON
tblSupportedCommunity.Community = qryOnNotice.Community) LEFT JOIN
qryMoveOuts ON tblSupportedCommunity.Community = qryMoveOuts.Community) LEFT
JOIN qryMoveOutsNotFullfilled ON tblSupportedCommunity.Community =
qryMoveOutsNotFullfilled.Community) ON qryUnkExpirations.Community =
tblSupportedCommunity.Community) ON qryMonth2Month.Community =
tblSupportedCommunity.Community) LEFT JOIN qryTransfers ON
tblSupportedCommunity.Community = qryTransfers.Community
ORDER BY tblSupportedCommunity.ROC, tblSupportedCommunity.Community;

I've got the combo box to populate with the data I want, but it won't do
anything when I select a specific entry. I'd like to use it to update the
rest of the form.

Any help would be appreciated. Thanks ever so.
 
A

Allen Browne

You have an combo, with these properties:
Column Count 2
Bound Column 1
Control Source {left blank}
The combo is on a form, and you are using the AfterUpdate event of the combo
to find the matching record in the form.

What's happening? Error message? Nothing at all?

Post the code as you have it in the AfterUpdate event procedure of the
combo.

Also, if you open tblSupportedCommunity in design view, what is the Data
Type of the ROC field?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

JoAnnP said:
Thanks Allen & Christy, but it's still not working. I tried both methods,
and the combo box will show all the available records, but when I click on
one, nothing. Does it matter that I have a subform within my form?
Thanks
ever so!

JoAnnP said:
I'm sure this is simple and I used to know how to do this, but I'm unable
to
get a combo box on a form to allow selection of records contained in it.
And it's probably been covered somewhere in here, but I'm not seeing it.
So,
to make a long question long...

I've set it as an unbound control with the row source as this query:
SELECT
DISTINCT (qryReport.ROC), qryROC.ROC_Name FROM qryReport INNER JOIN
qryROC ON
qryReport.ROC=qryROC.ROC_ID;

It is in a form where the source is this query: SELECT
tblSupportedCommunity.ROC, tblSupportedCommunity.Community,
qryTotalQ4Expirations.Total AS [Current Expirations Q4 2006],
qryTotalQ4Expirations.October AS [Current Expirations October],
qryTotalQ4Expirations.November AS [Current Expirations November],
qryTotalQ4Expirations.December AS [Current Expirations December],
qryRenewal.Total AS [Q4 2006 Renewals], qryRenewal.October AS [Renewals
October], qryRenewal.November AS [Renewals November], qryRenewal.December
AS
[Renewals December], qryPendingRenew.Total AS [Q4 Pending Renewals],
qryPendingRenew.October AS [Pending Renewals October],
qryPendingRenew.November AS [Pending Renewals November],
qryTransfers.Transfers, qryPendingRenew.December AS [Pending Renewals
December], qryOnNotice.[On Notice] AS [Q4 2006 On Notice], IIf([MoveOuts]
Is
Null,0,[MoveOuts]) AS [Q4 2006 Move Outs],
qryMoveOutsNotFullfilled.MoveOutNotFullfill AS [Q4 2006 Move Out,
Non-Fullfilled, Eviction & Skips], IIf(qryUnkExpirations!Total Is
Null,0,qryUnkExpirations!Total) AS [Q4 2006 Unknown],
qryMonth2Month.Month2Month AS [Q4 2006 MTM]
FROM (qryMonth2Month RIGHT JOIN (qryUnkExpirations RIGHT JOIN
((((((tblSupportedCommunity LEFT JOIN qryTotalQ4Expirations ON
tblSupportedCommunity.Community = qryTotalQ4Expirations.Community) LEFT
JOIN
qryRenewal ON tblSupportedCommunity.Community = qryRenewal.Community)
LEFT
JOIN qryPendingRenew ON tblSupportedCommunity.Community =
qryPendingRenew.Community) LEFT JOIN qryOnNotice ON
tblSupportedCommunity.Community = qryOnNotice.Community) LEFT JOIN
qryMoveOuts ON tblSupportedCommunity.Community = qryMoveOuts.Community)
LEFT
JOIN qryMoveOutsNotFullfilled ON tblSupportedCommunity.Community =
qryMoveOutsNotFullfilled.Community) ON qryUnkExpirations.Community =
tblSupportedCommunity.Community) ON qryMonth2Month.Community =
tblSupportedCommunity.Community) LEFT JOIN qryTransfers ON
tblSupportedCommunity.Community = qryTransfers.Community
ORDER BY tblSupportedCommunity.ROC, tblSupportedCommunity.Community;

I've got the combo box to populate with the data I want, but it won't do
anything when I select a specific entry. I'd like to use it to update
the
rest of the form.

Any help would be appreciated. Thanks ever so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top