Unbound boxes

  • Thread starter Thread starter APH
  • Start date Start date
A

APH

Hi I have an unbound box - combo4 - in the hearder of a form which find data
based on the follows and displays the record
SELECT [tblOrganisations].[RecordId],
[tblOrganisations].[EstablishmentName], [tblOrganisations].[PostCode] FROM
tblOrganisations ORDER BY [tblOrganisations].[EstablishmentName];

This works Ok

Is it possible to modify this and have two button so that on button 1 can i
can the data as above in the unbound box, but on pressing button 2 I would
have the following

SELECT [tblOrganisations].[RecordId], [tblOrganisations].[PostCode],
[tblOrganisations].[EstablishmentName] FROM tblOrganisations ORDER BY
[tblOrganisations].[PostCode];

Thanks

Alex
 
Another approach would be to put an unbound option group in the header, with
two choices - sort by Establishment, and sort by PostCode. In the option
group's After update event, you set the combo box's control source.

Good luck!

Jeff Boyce
<Access MVP>
 
Jeff is that possible - sorry of course that's possible - I just couldn't
get it to set the combo box properly. I managed the sql, but could apply it
to the combo box ( I am assuming that's how it would be don e!)

Alex
 
Alex

Take a look at the AfterUpdate event for the option group. Take a look at
the .RowSource property of the combo box.

In the option group AfterUpdate event, include something like (actual syntax
may vary):

If Me!optYourOptionGroupControlName = 1 Then
Me!cboYourComboBoxName.RowSource = " ... your first SQL or your
first query name here"
ElseIf Me!optYourOptionGroupControlName = 2 Then
Me!cboYourComboBoxName.RowSource = " ... your second SQL or your
second query name here"
Else
'handle the error
End If

Good luck

Jeff Boyce
<Access MVP>
 
Jeff
Thanks - I should have known that ! - dont do enough of Access design work
to keep fluent.

Thanks again
Alex
 
Back
Top