Leslie,
That's not the code I gave you to try.
And, my code used the names you used in your posts... so if they're
wrong, I can't tell that. Let's try again....
Let me write the code using example names, and you replace those
names
with your own...
(all code on one line..)
=DLookup("[FieldNameYourLookingUp]","TableYourUsing","[TheFieldInYourTable]
=
Forms![YourMainFormName]![YourSubFormName].Form![FieldInSubformThatHasTheValueYourLookingUp]")
Still fails? Then... post your code exactly... and...
Al,
Thank you for hanging in there with me. I have definitely not had luck
with
this. I'm obviously doing something wrong, and DLookup is not an easy
function to work with.
This is my current syntax which works in the SubForm -- by itself:
=DLookUp("[SoftwareName]","Software","[SoftwareID] = " &
Forms!UserSoftware!SoftwareID & "")
I do get a warning on my SoftwareName in the UserSoftware field which
has
the Lookup tied to it saying that there is a "circular reference" in
the
DLookup.
I don't understand the need for the & sign, but if I remove that & sign
and
the quote before the first & sign and the first of the two quotes after
the
second &, the query gives me an error. Possibly my fields are not
defined
exactly the same??? Software ID is an "Auto Numbered" field in the
Software
table and it is a "Numeric" field in my UserSoftware table.
If I modify the above in the User Form's imbedded SubForm and change
the
Syntax to:
=DLookUp("[SoftwareName]","Software","[SoftwareID] = " &
Forms!User!UserSoftware!SoftwareID & "")
I get the #Name? error.
These are the tables and fields of interest:
UserSoftware Table:
UserID (Numeric)
SoftwareID (Numeric and ComboBox)
SoftwareName (Text and a "Text Box" field)
Software Table:
SoftwareID (AutoNumbering)
SoftwareName (Text)
UserSoftware FORM:
SoftwareID (Does a Query on Software ID and SoftwareName)
SoftwareName ( Performs
=DLookUp("[SoftwareName]","Software","[SoftwareID]
=
" & Forms!UserSoftware!SoftwareID & "") )
User FORM:
Has UserSoftware FORM imbedded, tied by User.UserID and
UserSoftware.UserID
(both numeric - User.UserID is autonumbered and UserSoftware.Userid is
numeric)
Thank you for your help. If you want I can send you some screen shots
offline, if you think that would help. You can reach me at leslief at
oregonaero dot com.
Thanks!
Leslie
:
Sounds like a syntax error... I tested my code, and it works... I
just
subsituted my form/table names and controls, but left the syntax just
as
it
was.
**Cut and Paste what you have directly into your next email reponse.
**The code goes all on one line, and drop any >'s email might add.
=DLookUp("[SoftwareName]","Software","[SoftwareID] =
Forms!User!UserSoftware.Form!SoftwareID")
Also, make sure all your names/controls are correct.
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
Al,
I tried this and got the following error:'
"The expression is typed incorrectly, or it is too complex to be
evaluated.
For example, a numeric expression may contain too many complicated
elements.
Try simplifying the expression by assigning parts of the expression
to
variables."
I had cut and pasted what you typed.
Any other ideas?
Leslie
:
Try,
=DLookUp("[SoftwareName]","Software","[SoftwareID] =
Forms!User!UserSoftware.Form!SoftwareID")
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions