sja13
Professional Idiot
- Local time
- Today, 00:40
- Joined
- May 3, 2017
- Messages
- 63
I am trying to show a value on a form, but can’t work out how to do it.
I have been using Excel (cell formulae and VBA) for years, but this is my first venture into Access.
I’m not looking for a VBA solution, just trying to work out how to do what I’m sure should be a simple routine task.
I have the following tables, with the stated fields
Item Table (tblItem)
ID
Other data fields
fkItemToBoard
Board table (tblBoard)
ID
BoardName
Other data fields
fkBoardToLocation
Location table (tblLocation)
ID
LocationName
Other data fields
I have a form (frmItem) on which I have text boxes showing details for each of the Items.
The form’s Control Source is tblItem.
To show the Board on which the Item lives, I’ve entered
as the Text Box’s Control Source. This works fine.
How do I show the value LocationName on the Form?
I can’t work out how to “nest” a DLookUp inside another DLookUp.
I’ve tried showing the fkBoardToLocation on the Form in a Text Box (tbxLocId) then using
, but this just gives me a “#Name?” error.
Can any kind soul help me?
I have been using Excel (cell formulae and VBA) for years, but this is my first venture into Access.
I’m not looking for a VBA solution, just trying to work out how to do what I’m sure should be a simple routine task.
I have the following tables, with the stated fields
Item Table (tblItem)
ID
Other data fields
fkItemToBoard
Board table (tblBoard)
ID
BoardName
Other data fields
fkBoardToLocation
Location table (tblLocation)
ID
LocationName
Other data fields
I have a form (frmItem) on which I have text boxes showing details for each of the Items.
The form’s Control Source is tblItem.
To show the Board on which the Item lives, I’ve entered
Code:
=DLookUp("BoardName","tblBoard","ID = " & [Forms]![frmItem]![fkItemToBoard])
How do I show the value LocationName on the Form?
I can’t work out how to “nest” a DLookUp inside another DLookUp.
I’ve tried showing the fkBoardToLocation on the Form in a Text Box (tbxLocId) then using
Code:
=DLookUp("LocationName","tblLocation","ID = " & [Forms]![frmItem]![tbxLocId])
Can any kind soul help me?