Art,
Assuming CommunityID is numeric, I would just change the Row Source to:
SELECT CommunityID, CommunityName
FROM tlkpCommunity
UNION
SELECT 0, " ALL"
FROM tlkpCommunity
ORDER BY 2;
Regards,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, February 23, 2018 12:27 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Add Item to combobox in vba
Sent: Friday, February 23, 2018 12:27 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Add Item to combobox in vba
I am trying to add a an item to my combo box called cmbChooseCommunity. Its record source is
SELECT tlkpCommunity.CommunityID, tlkpCommunity.CommunityName FROM tlkpCommunity;
And at the top of the list I would like add the word "All" in case the user wants to see all the communities an not just a specific community.
This is where I am at...
Private Sub cmbChooseListingView_AfterUpdate()
Select Case Me.cmbChooseListingView
Case 2
Me.lblCommunityView.Visible = True
Me.cmbChooseCommunity.Visible = True
cmbChooseCommunity.AddItem Item:="All", Index:=0
Case Else
Me.lblCommunityView.Visible = False
Me.cmbChooseCommunity.Visible = False
End Select
End Sub
It bombs when I try to add the item like this because it says the record source has to be Field List.
Any ideas,
Thank you,
Art Lorenzini
Sioux Falls, SD
__._,_.___
Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar