Hello!
I am using Access 2003
I have been playing with DLookup all morning and have not been successful yet. I have never used this function...and have some limited experience with code. I will post what I have tried so far and hopefully someone can help me problem solve.
I have tried three different methods... (I know Calculation is spelled wrong..I have to go through my database and fix it everywhere just haven't had the time yet...)
1. I attempted to put the following code in the control box of an unbound text box to pull the correct NTG. No luck
= DLookup("[NTG]", "Calcluation Lookup Table TEST", "[num] = " _& Forms![Add New Subs]![num])
2. I attempted to put the following code in the before update event of a textbox bound to subfunctions.NTG (the field I want the value to store in). I took the sample code from the help function and adapted it to my database...
[code]
Dim varX As Variant
varX = DLookup("[NTG]", "Calcluation Lookup Table TEST", "[num] = " _
& Forms![Add New Subs]![num])
[code]
3. I attempted to put the following code in the record source of a textbox bound to subfunctions.NTG.
= DLookup("[NTG]", "Calcluation Lookup Table TEST", "[Me]![num] = " _ &
Forms![Add New Subs]![num])
What am I missing? I do not have an experience with DLookup...can someone help me?
The goal is to have the "library" value from [Calcluation Lookup Table TEST].[NTG] populate in the NTG field in a form (form filtered by [num] field based on previous form) and be able to revise and store it in [Subfunctions].[NTG]
I have tried pulling it in as default as well but no luck.
I am not getting any error messages, nothing appears in the textbox.
Thanks,
Annemarie