473,372 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

DLookup help needed

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
Nov 28 '06 #1
1 1777
NeoPa
32,556 Expert Mod 16PB
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
In 1 try
= DLookup("[NTG]", "[Calcluation Lookup Table TEST]", "[num] = " & Forms![Add New Subs].[num])
If that doesn't work I'd suggest that the form of the DLookup() function is not your problem.
Check spellings and all syntax.
Nov 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ogilby1 | last post by:
when using/writing dlookup the expression should be placed in the control source field of the properties? under what circumstances is it "put" in the beforeupdate" or "afterupdate"?
5
by: Kalvin Schroder | last post by:
I am fairly new to Access, and am trying to put together an invoice form. The main form in called InvoiceDetailFm. Source is the table InvoiceDetail and has invoice number, saleman, and CustID as...
6
by: Don Sealer | last post by:
I've written this expression for a DLookup function. It works almost alright. What I'm trying to do is type in a description and the ID field (number) populates automatically. It works almost as...
13
by: nzyui | last post by:
Trying to lookup a field from a table called condition this is a separate table not linked to anything: setup as shown Code S M L DG 1 2 3 RI 2 4 5 need...
1
by: TerryD | last post by:
I have a form that has an unbound text field that I am using DLookup in to display the values from a Temp Table. My program calls for me pushing a button to print a report, which runs a query first...
3
by: MattieG | last post by:
Hi Im trying to do a DLookup on the following. I have a form field called StartDate and i want to find a price from table where Forms!Formname!StartDate BETWEEN Start2 and End2. I just cant...
3
by: hrreece | last post by:
I am trying to use the Dlookup expression in a macro to pull the value from the "Price" field in the following query. The query works fine and the Dlookup function did as well until I added a new...
9
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.