Re: Control Source/Record Source issue

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Tina!

I have been playing with DLookup all morning and have not been
successful yet. I have never used this function... I will post what I
have been trying 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
by my fields...

Dim varX As Variant
varX = DLookup("[NTG]", "Calcluation Lookup Table TEST", "[num] = " _
& Forms![Add New Subs]![Num])

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?

Again, I want to take the "library" value from Calcluation Lookup Table
TEST.NTG and be able to revise and store it in Subfunctions.NTG I
have tried pulling it in as default but no luck.

Thanks,
Annemarie


tina wrote:
read up on the DLookup() function in Access Help; it may give you what you
need.

hth


"Annemarie" <AnnemarieHarding@xxxxxxxxx> wrote in message
news:1164668074.202829.199060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have been trying to pull a value from one table (ex [Lookup
Table].[NTG]) on a form and have that value be a baseline. I would
like this number to store in a field in another table (ex
[Subfunctions].[NTG]) this way the user can change the value if needed
for a specific record and not change the pre-set "library" value.

I have tried using [Lookup Table].[NTG] as the Default, and
[Subfunctions].[NTG] as the control source but the number will not pull
in. The form is based on a query that includes both values, so i have
tried to filter the form and have the value pull into the the
[Subfunctions].[NTG] from either that forms' [Lookup Table].[NTG] or a
previous forms' [Lookup Table].[NTG] ...previous form based on same
query. I am not having any luck.

I have the form filtered based on another field value already. The
reason I have to have the second form is to enter additional data based
on the first form...but there are two different forms asking for
different data that pop up based on the value in a field on the first
form. How do I pull this value from one table and store it in another??


.



Relevant Pages

  • Re: Control Source/Record Source issue
    ... The form is based on a query that includes both values, ... How do I pull this value from one table and store it in another?? ...
    (microsoft.public.access.formscoding)
  • Pull Value from one table and deposit in another
    ... I have been trying to pull a value from one table (ex [Lookup ... like this number to store in a field in another table (ex ... The form is based on a query that includes both values, ... value in a field on the first form. ...
    (microsoft.public.access.forms)
  • Control Source/Record Source issue
    ... I have been trying to pull a value from one table (ex [Lookup ... Table].) on a form and have that value be a baseline. ... The form is based on a query that includes both values, ... How do I pull this value from one table and store it in another?? ...
    (microsoft.public.access.formscoding)
  • Trouble With saving fields brought in using combo box.
    ... and store the contact info for customers. ... trying to put a full name box on the query, that uses the FirstName, ... in the Master Query. ... pull the separate fields from the Contacts query(FirstName, ...
    (comp.databases.ms-access)
  • Need help with criteria for a query - want all records or selection from combo box
    ... I have a query with criteria that comes from a combo box on a form. ... the selection in the combo box or the user can pull all records. ... to allow for the option of all records, but without any luck. ...
    (comp.databases.ms-access)