98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » access 2003 training course london - Option Group
access 2003 training course london - Option Group
Resolved · Low Priority · Version Standard
Robin has attended:
Access Intermediate course
Access Advanced course
Option Group
I have a drop down combo box on a form which allows the user to select a record.
I would like to be able to filter the list of available records in the drop down list subject to a yes/no tick box that is set in the source table.
I have created an option group with three options: Current, Old and All.
If the user clicks current, the drop down combo box needs only to contain only those records where the field in the source table is set to true.
The opposite obviously needs to be applied if the user clicks old and the all button would restore the full list.
I'm sure this is simple but I just can't seem to get it to work.
Thanks in advance.
Robin
RE: Option Group
Robin
This will need some VBA coding, but the gist of the code is as follows:
When one of the Options in the Option group is selected code needs to imediately run a query filtering the table to the criteria of the selected option.
The data in this query is then loaded into the Combo box
Regards
Carlos
RE: Option Group
Thanks for your reply.
I originally created seperate queries but solved it as follows:
AfterUpdate.....
Select Case Frame69.Value
Case 1
Combo59.RowSource = "SELECT tblClients.CustomerID, tblClients.CompanyName, tblclients.CurrentClient " & _
"FROM tblClients " & _
"WHERE (((tblClients.CurrentClient) = True))" & _
"ORDER BY tblClients.CompanyName"
Me.Combo59.Requery
Case 2
Combo59.RowSource = "SELECT tblClients.CustomerID, tblClients.CompanyName, tblclients.CurrentClient " & _
"FROM tblClients " & _
"WHERE (((tblClients.CurrentClient) = False))" & _
"ORDER BY tblClients.CompanyName"
Me.Combo59.Requery
Case 3
Combo59.RowSource = "SELECT tblClients.CustomerID, tblClients.CompanyName FROM tblClients ORDER BY tblClients.CompanyName;"
Me.Combo59.Requery
End Select
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Changing MS Programs Text SizeA handy way to increase or decrease the size of text in Microsoft Word, Microsoft PowerPoint, Microsoft FrontPage, or Microsoft Publisher, first, select the text you want to resize. |