Default display record from filtered list box (1 Viewer)

Cotty42

Registered User.
Local time
Today, 23:15
Joined
Feb 27, 2014
Messages
102
Hi All

I have a form which displays records based on a selection from a list box on the form.

The default record displayed when I load the form is record 1 from the table, this is not an issue when I initially load the form but I also have options to filter the records displayed in the list box using various SQL statements, depending on the options selected.

However, when I apply one ofthese filters to the list box the default record displayed on the form still defaults to the first record in the table, which may not be included in the filtered list box.

Is there a way I can default to the first record listed in the list box rather than the first record in the table.

Many thanks

Dave
 

GohDiamond

"Access- Imagineer that!"
Local time
Today, 18:15
Joined
Nov 1, 2006
Messages
550
Try adding your FILTER criteria to the form property:

You can set a default value for the List Box then

Filter: "Enter the SQL statement of the select query based on your ListBox value"
Filter on Load: YES

Hope that helps...
Cheers!
Goh
 

Cotty42

Registered User.
Local time
Today, 23:15
Joined
Feb 27, 2014
Messages
102
Thanks Goh but that didn't work.

I eventually did a work round fudge by setting focu to the ListBox and then sending keystrokes (SendKey "{TAB}") to move focus around the form in the background, which appears to work.

Not an ideal solution, I know, but if it works - don't fix it!

Cheers

Dave
 

Users who are viewing this thread

Top Bottom