control default value

G

gator

I have a combo box Row Source set as
SELECT DISTINCT FundDate FROM FundsAllYears ORDER BY FundDate DESC

How do i set the default value to be the latest date from the Row Source
above?
 
M

Marshall Barton

gator said:
I have a combo box Row Source set as
SELECT DISTINCT FundDate FROM FundsAllYears ORDER BY FundDate DESC

How do i set the default value to be the latest date from the Row Source
above?


Since the row aource is sorted to put the latest date in the
first record, you can use:
[the combo box].ItemData(0)
 
G

gator

I get the message....
the method you tried to invoke on an object failed.
......but then seems to work? Is this OK?

Marshall Barton said:
gator said:
I have a combo box Row Source set as
SELECT DISTINCT FundDate FROM FundsAllYears ORDER BY FundDate DESC

How do i set the default value to be the latest date from the Row Source
above?


Since the row aource is sorted to put the latest date in the
first record, you can use:
[the combo box].ItemData(0)
 
M

Marshall Barton

A failure message is never ok.

What, exactly did you do?

How did you figure out that the message came from the text
box's DefaultValue property? (Is that an exact copy of the
error message?)
--
Marsh
MVP [MS Access]

I get the message....
the method you tried to invoke on an object failed.
.....but then seems to work? Is this OK?

Marshall Barton said:
gator said:
I have a combo box Row Source set as
SELECT DISTINCT FundDate FROM FundsAllYears ORDER BY FundDate DESC

How do i set the default value to be the latest date from the Row Source
above?


Since the row source is sorted to put the latest date in the
first record, you can use:
[the combo box].ItemData(0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top