473,396 Members | 1,832 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,396 software developers and data experts.

DLookup & Cross-Tab

Hello Everyone!

[AdminEdit]This question was split from an original found at The Dreaded DLookup[/AdminEdit]

...

My second DLookup is a bit more complicated, and why I thought taking a step back to a simpler dlookup function would help me to understand dlookups better, hence the first dlookup. Again, I am using the "Control Source" in Access where my code looks like the below:
Expand|Select|Wrap|Line Numbers
  1. =DLookup("Time","Travel","StartNode = ' " & [StartNode] & " '  and EndNode = ' " & [EndNode] & " ' ")
While I don't get an error, but I am not getting a value either. The "Time" value that I am trying to return is the intersection of two user entered values, similar to the attached table named "tbl".

I'm a bit lost and my Mt. Dew is running low. Please help.

Attached Images
File Type: png tbl.PNG (55.2 KB, 293 views)
Apr 19 '19 #1
3 1281
NeoPa
32,556 Expert Mod 16PB
It's very unclear what you're working with as the illustration doesn't match the code in any way shape or form.

However, assuming there's any sense in there at all, you will struggle to match values if you keep throwing extraneous spaces into strings in your code. If it matches the string value then it certainly won't match that same string value after spaces have been added as you have in your code.

It should look more like (I make no guarantees mind, as I'm mainly guessing at what we're working with.) :
Expand|Select|Wrap|Line Numbers
  1. =DLookup("[Time]","[Travel]","([StartNode]='" & [StartNode] & "') AND ([EndNode]='" & [EndNode] & "')")
Apr 20 '19 #2
twinnyfo
3,653 Expert Mod 2GB
Mickey,

Is that image a “real” table or a spreadsheet or something else? It is unclear how you could use a DLookup on what you have with the syntax you’ve posted.
Apr 20 '19 #3
NeoPa
32,556 Expert Mod 16PB
Thank you Twinny. Either that makes absolutely no sense or I'm going mad. Either was possible TBF :-D

@DivingMickey.
I know almost everything we've said so far has been criticism of how you've posted, but don't take that to heart. Think of it as guidance rather than any indication you don't fit here. Obviously pay attention to the comments and learn from them, but don't assume we're either hostile or already impatient with you. We just need to get things on a workable footing ASAP. We look forward to your next post that will hopefully make your question and your need clearer.
Apr 20 '19 #4

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

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Tripp Knightly | last post by:
I have a lookup table from which I want to categorize various bands of customer net income. Some of the income is positive, some is negative. The bands vary in size (ie, <500, -200 to 0, 100 to...
2
by: Catherine | last post by:
I am trying to create a report that will give me q total count by month to date, and then another by year to date. Example: Discharges By Type Month To Date Year To Date...
1
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals....
2
by: MLH | last post by:
I run the following command in main menu form open event code... Me!MainMenuLabel.Caption = DLookup("", "qryAdminList") & Chr$(10) & Chr$(13) & DLookup("", "qryAdminList") & Chr$(10) & Chr$(13)...
1
by: Sheldon Mopes | last post by:
I have read a few articles that state that a multi-user app over a network will run faster if DSum & DCount functions are replaced with SQL statements replicating the functions. As I am a novice to...
27
by: Bob | last post by:
running access 2k; mdb w/ linked tables to another mdb (front/back-end); trying to run a query that updates a table FROM information from a crosstab query. I AM NOTT trying to update the...
12
by: AricC | last post by:
Howdy Errrrbody, I'm new here! I have a few questions that I can't seem to get answered, maybe you all can help. I am writing an access program ( first time I'm accustomed to .Net + Sql Server...
7
by: supertsik | last post by:
Hi After a lot of research I didn't manage to solve the following problem: I have a table called 'Autos' with fields , , 1 ¦ Mike ¦ BMW 2 ¦ Mike ¦ Ford 3 ¦ Mike ¦ Toyota 4 ¦ Nick ¦ Audi
3
by: kcludick | last post by:
Hi, I have a table called Tbl_ComboBox, and a form named Form1. On the form I have a combobox where you select an employee code. I need to do a DLookUp from an Unbound text box to auto fill the Name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.