Still need help

  • Thread starter Thread starter Jay Magness
  • Start date Start date
J

Jay Magness

Hi all,

I am using DLookup in a subform and for some reason the
data is not updating. Here is the deal. I can run the
DLookup when I run the subform as a root form, but when I
add the Master form to the formula I get no error and the
data is not added to the table.

I think the formula is working since I do not get any
errors, but it is just not add the data.

Any ideas?

Actual Formula:

[MatDecsripton] = DLookup("[Descr]", "[vendorq1]", "[item]
=Forms!PEntery1!Mattbl1![MatItemc]")

[MatDecsripton] = Field to be updated with lookedup data

[Descr] = Field to pull the data from
[vendorq1] = Tble to get the data to be added

[item] = Field to Index on in the Dta Source Table

PEntery1 = Main Form

Mattbl1 = Subform Name

[MatItemc] = Criteria Field

Thank you in advance for your input and help,

Jay

..
 
if [item] is numeric, try

[MatDecsripton] = DLookup("[Descr]", "[vendorq1]", "[item]
=" & [Forms]![PEntery1]![Mattbl1]![MatItemc])

if [item] is text, try

[MatDecsripton] = DLookup("[Descr]", "[vendorq1]", "[item]
='" & [Forms]![PEntery1]![Mattbl1]![MatItemc] & "'")

if still not working, read on:
you say that "Mattbl1" is the subform name, but is it the *name of the
subform control* in the main form? that is not the same thing. to check,
open your main form in design view. in design view, click on the subform
once to select it. open the Properties box and click on the Other tab. look
at the Name property - that is the name you need to use in the reference.
once you've verified the subform control name as correct in the reference,
if it still doesn't work, then try altering the reference, as

[MatDecsripton] = DLookup("[Descr]", "[vendorq1]", "[item]
=" & [Forms]![PEntery1]![Mattbl1].Form![MatItemc])

again, use the alternate syntax if [item] is text rather than numeric

hth.
 
Back
Top