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  

DLookUp in a form



 
 
Thread Tools Display Modes
  #1  
Old May 5th, 2008, 02:49 AM posted to microsoft.public.access.forms
Charles via AccessMonster.com
external usenet poster
 
Posts: 19
Default DLookUp in a form

I have a form that I use for control buttons, I created a text box to enter
the date used by an append query to create a table for work schedules. I
added another text box with the following control: DLookUp("[Day_Txt]",
"tbl_Day","Weekday(ServDate)=[Day_Nr]") the result of this box would be used
as the criteria in a query to select the schedules for that particular day.
The problem is that the weekday text box is only updated if I click on the
design dispaly and then return to the form display. Is there a solution that
I can display the weekday based on the date displayed in the "ServDate" text
box?

Thanks
Charles

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200805/1

  #2  
Old May 5th, 2008, 12:21 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default DLookUp in a form

What exactly are you looking for? If ServDate contains a date, you can
determine the name of the day using

=Format(Me![ServDate], "ddd") (for Sun, Mon, Tue,...)

or

=Format(Me![ServDate], "dddd") (for Sunday, Monday, Tuesday,...)


As to why your DLookup didn't work, you need to ensure that you're passing a
value, not a reference. In other words, you need

DLookUp("[Day_Txt]","tbl_Day",Weekday(ServDate) & "=[Day_Nr]")

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Charles via AccessMonster.com" u35571@uwe wrote in message
news:83acc6b6a9f49@uwe...
I have a form that I use for control buttons, I created a text box to enter
the date used by an append query to create a table for work schedules. I
added another text box with the following control: DLookUp("[Day_Txt]",
"tbl_Day","Weekday(ServDate)=[Day_Nr]") the result of this box would be
used
as the criteria in a query to select the schedules for that particular
day.
The problem is that the weekday text box is only updated if I click on the
design dispaly and then return to the form display. Is there a solution
that
I can display the weekday based on the date displayed in the "ServDate"
text
box?

Thanks
Charles

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200805/1



  #3  
Old May 5th, 2008, 01:23 PM posted to microsoft.public.access.forms
Charles via AccessMonster.com
external usenet poster
 
Posts: 19
Default DLookUp in a form

Thank you.
Your variation of DLookUp works fine. This will allow me to delete 6 bottons
and 6 queries.

Thanks again

Charles

Douglas J. Steele wrote:
What exactly are you looking for? If ServDate contains a date, you can
determine the name of the day using

=Format(Me![ServDate], "ddd") (for Sun, Mon, Tue,...)

or

=Format(Me![ServDate], "dddd") (for Sunday, Monday, Tuesday,...)

As to why your DLookup didn't work, you need to ensure that you're passing a
value, not a reference. In other words, you need

DLookUp("[Day_Txt]","tbl_Day",Weekday(ServDate) & "=[Day_Nr]")

I have a form that I use for control buttons, I created a text box to enter
the date used by an append query to create a table for work schedules. I

[quoted text clipped - 12 lines]
Thanks
Charles


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200805/1

 




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 11:37 AM.


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