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

access 2003 training course london - option group

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

ResolvedVersion 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:

Compact database automoatically

To ensure optimal performance, you should compact and repair your

Open the Access database or Access project that you want Access to compact automatically.
On the Tools menu, click Options.
Click the General tab.
Select the Compact on Close check box.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.