put query result to cbo control on the form

  • Thread starter Thread starter Song Su
  • Start date Start date
S

Song Su

I have a query as follows:

SELECT TOP 1 qryVisitData.timeIn
FROM qryVisitData
ORDER BY qryVisitData.timeIn DESC;

I want to assign the query result to my cboTO control on my form so when I
open the form, I already have the default date. How to do it? Thanks.
 
Type that SQL statement in the Row Source property of the combobox. Do not
use quotes to delimit what you input, in design view of the form, the
property RowSource knows it is a string you are supplying. Also, be sure the
Row Source Type is set to Table/Query (which is so, by default).

Hoping it may help,
Vanderghast, Access MVP
 
Why bother using a combo box if you're only going to allow a single choice?

Try an unbound text box with a control source of

=DMax("TimeIn", "qryVisitData")
 
Thanks, Doublas. It works great! I use combo box because the drop down
button will activate a calendar control so user can pick a different date.
 

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

Back
Top