Hey,
I have a form which I am looking to select from a list and display information from a table in to a textbox using DLookup. So I need the control source DLookup to be something like the following:
= DLookup ( txtDiaryFeed , tbl_Net_Diary , TheDate = txtLocalSystemDate)
I just cannot see where I am going wrong, please can you have a look,
Thanks,
Malcolm
Fields are:
cbxDiaryList (actual FieldName translates in to the field txtDiaryFeed)
txtDiaryFeed (the name of the Field in the Table) - on a subform (subfrmHome)
txtDiary (where the text will be displayed) - on a subform (subfrmHome)
txtLocalSystemDate - on the main form (frmBackground), can be any date over a number of years
Table is called tbl_Net_Diary
Amongst many other things I have tried is:
=DLookUp([txtDiaryFeed],[tbl_Net_Diary],&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&)
=DLookUp([Forms].[frmBackground]![subfrmHome]![txtDiaryFeed],[tbl_Net_Diary])
= DLookup("[txtDiaryFeed]", "[tbl_Net_Diary]" , "[TheDate] ='" & Forms![frmBackground]![txtLocalSystemDate] & "'")
=DLookUp([Forms].[frmBackground]![subfrmHome]![txtDiaryFeed],[tbl_Net_Diary],&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&)
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&[TheDate]=14/02/2021&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&14/02/2021 = [TheDate]&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","' [TheDate] = 14/02/2021'")
I have a form which I am looking to select from a list and display information from a table in to a textbox using DLookup. So I need the control source DLookup to be something like the following:
= DLookup ( txtDiaryFeed , tbl_Net_Diary , TheDate = txtLocalSystemDate)
I just cannot see where I am going wrong, please can you have a look,
Thanks,
Malcolm
Fields are:
cbxDiaryList (actual FieldName translates in to the field txtDiaryFeed)
txtDiaryFeed (the name of the Field in the Table) - on a subform (subfrmHome)
txtDiary (where the text will be displayed) - on a subform (subfrmHome)
txtLocalSystemDate - on the main form (frmBackground), can be any date over a number of years
Table is called tbl_Net_Diary
Amongst many other things I have tried is:
=DLookUp([txtDiaryFeed],[tbl_Net_Diary],&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&)
=DLookUp([Forms].[frmBackground]![subfrmHome]![txtDiaryFeed],[tbl_Net_Diary])
= DLookup("[txtDiaryFeed]", "[tbl_Net_Diary]" , "[TheDate] ='" & Forms![frmBackground]![txtLocalSystemDate] & "'")
=DLookUp([Forms].[frmBackground]![subfrmHome]![txtDiaryFeed],[tbl_Net_Diary],&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&)
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&[TheDate]=Forms![frmBackground]![txtLocalSystemDate]&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&[TheDate]=14/02/2021&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","&14/02/2021 = [TheDate]&")
=DLookUp("[Forms].[frmBackground]![subfrmHome]![txtDiaryFeed]","[tbl_Net_Diary]","' [TheDate] = 14/02/2021'")