Re: Lookup Field in form from subform
- From: "Signe B via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jul 2005 07:39:36 GMT
Hi John
Sorry about the confusion, off course it is the tables that have a
relationship. I have tried Dlookup (with the table names) but the field then
just stays blank.
Do you have an idea why?
The tables have the same name as the forms, could that be a problem?
Signe
John Vinson wrote:
>>Hi
>>I have a subform A (with a main form B) and another form C. I want to look up
>>a field in Form C and add it to a field in subform A. The to forms (A and C)
>>are linked in a one to many relationsship.
>
>Whoa. Stop right there.
>
>Forms are JUST WINDOWS. They do not contain data. You cannot "look up
>a field" in Form C - you can reference the value of a Control on form
>C to see the value of a current record. Forms are NOT "in a one to
>many relationship" - only Tables can participate in relationships!
>
>The data is not stored in form C; it's stored in a Table, whatever
>table you're using as Form C's Recordsource. If you want data, get it
>from the Table, not from the form; DLookUp is one way to do so:
>
>DLookUp("[fieldname]", "[tablename]", "[IDfield] = " & [txtID])
>
>will look up the value of fieldname from tablename where the value of
>IDfield in the table is equal to the value in textbox txtID on the
>current form.
>
> John W. Vinson[MVP]
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200507/1
.
- Follow-Ups:
- Re: Lookup Field in form from subform
- From: Signe B via AccessMonster.com
- Re: Lookup Field in form from subform
- References:
- Lookup Field in form from subform
- From: Signe B via AccessMonster.com
- Re: Lookup Field in form from subform
- From: John Vinson
- Lookup Field in form from subform
- Prev by Date: Re: AfterUpdate event of Form
- Next by Date: Re: Lookup Field in form from subform
- Previous by thread: Re: Lookup Field in form from subform
- Next by thread: Re: Lookup Field in form from subform
- Index(es):
Relevant Pages
|