access 2003 training course london - option group

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum 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

resolvedResolved · 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


 

Access tip:

Changing MS Programs Text Size

A 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.

Then, to increase the font size, press CTRL+SHIFT+>.

To decrease the font size, press CTRL+SHIFT+<.

View all Access hints and tips


Server loaded in 0.08 secs.