Fran Smith
New member
- Local time
- Tomorrow, 09:09
- Joined
- Oct 15, 2011
- Messages
- 8
Hi,
I'm a newbie learner who has learned DAO (somewhat), but not used control source (I was told not to), but in this instance, I'm simply looking up an image to display. This is my expression:
DLookUp("[People]![Picture]","People","[People]![PeopleID]=txtIDMother")
I'm wanting to retrive into my form the attachment "Picture" (automatically named by Access for my attachment table field) from the "People" table for the field where the "txtIDMother" txt box (already retrived by DAO on form_load procedure) equals the "PeopleID" primary key in the "People" table.
The control source accepts the code, but it doesn't load onto the form - only flashes briefly.
Edit: Incidently, I just discovered that I can actually put an SQL statement in the control source. I tried, but the results are exactly the same as above, only faster. Here is my SQL:
="SELECT People.PeopleID,People.Picture.FileData,People.Picture.FileName, People.Picture.FileType
FROM People
WHERE (People.PeopleID)=" & [txtIDMother]
What have I got wrong?
Thanks in advance.
I'm a newbie learner who has learned DAO (somewhat), but not used control source (I was told not to), but in this instance, I'm simply looking up an image to display. This is my expression:
DLookUp("[People]![Picture]","People","[People]![PeopleID]=txtIDMother")
I'm wanting to retrive into my form the attachment "Picture" (automatically named by Access for my attachment table field) from the "People" table for the field where the "txtIDMother" txt box (already retrived by DAO on form_load procedure) equals the "PeopleID" primary key in the "People" table.
The control source accepts the code, but it doesn't load onto the form - only flashes briefly.
Edit: Incidently, I just discovered that I can actually put an SQL statement in the control source. I tried, but the results are exactly the same as above, only faster. Here is my SQL:
="SELECT People.PeopleID,People.Picture.FileData,People.Picture.FileName, People.Picture.FileType
FROM People
WHERE (People.PeopleID)=" & [txtIDMother]
What have I got wrong?
Thanks in advance.
Last edited: