A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Enter Table/Query value in Form



 
 
Thread Tools Display Modes
  #1  
Old October 25th, 2006, 04:00 PM posted to microsoft.public.access.forms
Scott
external usenet poster
 
Posts: 1,119
Default 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  
Old October 25th, 2006, 06:26 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old October 25th, 2006, 07:05 PM posted to microsoft.public.access.forms
Scott
external usenet poster
 
Posts: 1,119
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.