If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Enter Table/Query value in Form
I have an unbound text box on a form. I have a table with one field only (a
date field) that contains dates every two weeks (pay period ending date). I want the text box on the form to show the current pay period ending date. I have the following query SELECT First(Calendar.PeriodEndingDate) AS EndingDateCurrent FROM Calendar WHERE (((Calendar.PeriodEndingDate)Date())); How do I get this single value returned by the query to be the default value for the unbound text box on the form? Also, can the value be obtained on the form without using the query to filter the value first? Thanks, Scott |
#2
|
|||
|
|||
Enter Table/Query value in Form
If it is an unbound text box, put this in the Control Source of the text box:
=DLookup("[PeriodEndingDate]", "Calendar", "[PeriodEndingDate] #" & Date() & "#") "Scott" wrote: I have an unbound text box on a form. I have a table with one field only (a date field) that contains dates every two weeks (pay period ending date). I want the text box on the form to show the current pay period ending date. I have the following query SELECT First(Calendar.PeriodEndingDate) AS EndingDateCurrent FROM Calendar WHERE (((Calendar.PeriodEndingDate)Date())); How do I get this single value returned by the query to be the default value for the unbound text box on the form? Also, can the value be obtained on the form without using the query to filter the value first? Thanks, Scott |
#3
|
|||
|
|||
Enter Table/Query value in Form
It worked perfect, thank you!
"Klatuu" wrote: If it is an unbound text box, put this in the Control Source of the text box: =DLookup("[PeriodEndingDate]", "Calendar", "[PeriodEndingDate] #" & Date() & "#") "Scott" wrote: I have an unbound text box on a form. I have a table with one field only (a date field) that contains dates every two weeks (pay period ending date). I want the text box on the form to show the current pay period ending date. I have the following query SELECT First(Calendar.PeriodEndingDate) AS EndingDateCurrent FROM Calendar WHERE (((Calendar.PeriodEndingDate)Date())); How do I get this single value returned by the query to be the default value for the unbound text box on the form? Also, can the value be obtained on the form without using the query to filter the value first? Thanks, Scott |
Thread Tools | |
Display Modes | |
|
|