473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Source control on form DLookup not working

3 New Member
Hi,
I'm using the DLookup function in a field to provide the results of a calculation field from a qry.
Expand|Select|Wrap|Line Numbers
  1. =(DLookUp("[qryTotalBalance]![TotalRecAmt]","qryTotalBalance"))
I set the default value to 0.00 and format to currency.
I only see 0.00 not the field results.
I'm not sure what is wrong.
Any help is appreciated!
Thanks, NanR
Apr 29 '15 #1

✓ answered by NanR

I think I've got it. I used the following and added the conditional clause...
Expand|Select|Wrap|Line Numbers
  1. =(DLookUp("[qryTotalBalance]![NetBalance]","[qryTotalBalance]","[CustID]= " & Nz([CustID],0)))
Thank you!!

5 1731
twinnyfo
3,653 Recognized Expert Moderator Specialist
NanR,

Welcome to Bytes!

Where is this DLookUp() Function? Is it on a Form? What causes the value to update?

Also your syntax can be shortened:

Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[TotalRecAmt]","qryTotalBalance")
Apr 29 '15 #2
zmbd
5,501 Recognized Expert Moderator Expert
I've stepped this w/o the continuation, so it will not work w/o reformatting:
Expand|Select|Wrap|Line Numbers
  1. =(DLookUp("[qryTotalBalance]![TotalRecAmt]",
  2.    "qryTotalBalance",
  3.    Missing Conditional clause))
Allen Browne: Getting a value from a table: DLookup()

You may need the formal references depending on the context; however, TwinnyFo is correct that most of the time the syntax can be shortened.

Also in VBA, I advise building the where clause as a string variable first and then using the string variable in the function.
Apr 29 '15 #3
twinnyfo
3,653 Recognized Expert Moderator Specialist
Z,

Yes--although it is possible to get just the first value, but one should always include the conditional clause to find the "right" value.
Apr 29 '15 #4
NanR
3 New Member
Hi,
My DLookup field is on a form. I have two tables; tblOverdrawnAccts and tblRecoveryAcctGLs. I need totals for the overdrawn accts tbl and totals for recovery accts tbl.
I wrote a query to obtain these totals. Then I added a calculated field in the query to obtain the difference of these two totals. I am using the DLookup field on my form from the query fields. SQL of my query:
Expand|Select|Wrap|Line Numbers
  1. SELECT tblOverdrawnAccts.CustID
  2.    , tblOverdrawnAccts.TotalODAmt
  3.    , tblRecoveryAcctGLs.TotalRecAmt
  4.    , [tblOverdrawnAccts]![TotalODAmt]
  5.        -[tblRecoveryAcctGLs]![TotalRecAmt] 
  6.          AS NetBalance
  7. FROM tblOverdrawnAccts 
  8.       INNER JOIN tblRecoveryAcctGLs 
  9.          ON tblOverdrawnAccts.AcctID 
  10.             = tblRecoveryAcctGLs.AcctID;
I didn't think that I needed to add the conditional clause. If I do, I'm not sure how I would write it?
Thanks,NanR
Apr 29 '15 #5
NanR
3 New Member
I think I've got it. I used the following and added the conditional clause...
Expand|Select|Wrap|Line Numbers
  1. =(DLookUp("[qryTotalBalance]![NetBalance]","[qryTotalBalance]","[CustID]= " & Nz([CustID],0)))
Thank you!!
Apr 29 '15 #6

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

Similar topics

3
by: Jeff Dillon | last post by:
What are people using for source control for ASP and HTML files? We have a typical scenario here, a handful of developers working locally on development, an internal staging server, then an...
2
by: RSB | last post by:
Hi Every one, I am currently using Visual Studio .Net and trying to open a project from SourceSafe and once i open the project for the first time i get the following error/warning... "The...
5
by: clintonG | last post by:
A group of several developers working remotely from one another needs source control. What do you use in this regard? <%= Clinton Gallagher
1
by: adamcrew | last post by:
Hi, I'm not sure if this is truly a C++ question, but it's something that has only come up now that I'm working in a C++ environment. Essetnially, what has happened is that I've come in to a new...
1
by: Vladimír Kolesnik | last post by:
Hi, there we need help concerning setting project under source control. We want to have a project on the server, and developers in the local network working on this project. We decided to use...
0
by: Wayne Sepega | last post by:
We are using windows 2003 standard server, VSS 2005 and VS 2005 (mostly team dev, but some team arch and suite) We run windows 2003 on our development boxes, this gives us the ability to host...
8
by: | last post by:
I need source control to serve just one developer: me. Can someone suggest a system that would suit my needs? I am the only person writing code, and I manage the servers. Many of the SC solutions...
22
by: MarkusR | last post by:
I am currently using StarTeam for my source control. (Will eventual switch to whatever the latest Visual Source Safe is going to be called). With debug, installers, deploy and everything the...
1
by: Clive Dixon | last post by:
VS 2005 Professional How can I disable source control binding when working with a solution and its projects on my own machine, without modifying the .sln and .vcproj files and thus screwing up...
3
by: ºa¤Ö | last post by:
We are developing ASP.NET web application and using Visual source safe (VSS) to control our source code We developed a user control and it will been used by different project. I know there have...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.