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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|