473,320 Members | 2,112 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,320 software developers and data experts.

using DLOOKUP function but results #ERROR

2
I have, table (VENDOR LIST) who had vendor id, vendor name, address and TIN. I created a FORM, wherein, first combo box - PayeeName shows the vendor name, so I used the dlookup function for address.
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("ADDRESS","VENDOR LIST","VENDOR ID =" & [PayeeName])
using this function and it results = #error

How can I fix this. Thanks in advance for your reply
Oct 14 '19 #1

✓ answered by cactusdata

You should avoid spaces in field and table names, but now you have it, extend your syntax, and add quotes as PayeeName is text:

Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[ADDRESS]","[VENDOR LIST]","[VENDOR ID] ='" & [PayeeName] & "'")

3 2411
cactusdata
214 Expert 128KB
You should avoid spaces in field and table names, but now you have it, extend your syntax, and add quotes as PayeeName is text:

Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[ADDRESS]","[VENDOR LIST]","[VENDOR ID] ='" & [PayeeName] & "'")
Oct 14 '19 #2
NeoPa
32,556 Expert Mod 16PB
I have to say, as well as [PayeeName] looking like it's probably text, it also doesn't sound like it would be any sort of match for a field called [Vendor ID]. If it is a match then you really need to reconsider your naming of variables and fields.

Also, a better approach would be to populate the ComboBox with extra columns in the first place and reference these when you need the extra matching information. Extra columns can easily be hidden if you don't want them seen.
Oct 14 '19 #3
azyl10
2
Thank you for your help sir cactusdata.
Oct 15 '19 #4

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

Similar topics

2
by: Ronny Sigo | last post by:
Hello all, I already put the same question, only now I have more to tell ... Although I used this code before in the same routine (only the fieldname of the table differs) ___ at this point in the...
1
by: Edward S | last post by:
Friends, I had posted this on "Microsoft.Public.Access", But I did not get a satisfactory response. I have been struggling for nearly 2 days trying to crack this code. I really need help, could...
2
by: jonvan20 | last post by:
I have been having trouble with a simple Dlookup command that was Reccommended to me by a nice fellow named Vic, On the other hand I have statements like this that wont run they give me a run time...
3
reginaldmerritt
by: reginaldmerritt | last post by:
I'm using Dlookup to search a table for the first record it comes across that has a date >= the date i specifiy. e.g. formateddate = format(Me.SelectedDate,"mmddyy") VarX = DLookup("",...
5
by: nandithadevaraj | last post by:
Hi, I am working on oracle, frankly speaking till nw i have nt worked in oracle i need help please help me out in this actually i have written query using DLOOKUP function as DLOOKUP...
8
by: toadmaster | last post by:
I have a table called users and a field in that table called amountauthorized. My users enter a figure in a text box called estp on a form. estp is either equal to or less than the...
1
by: toadmaster | last post by:
I am trying to use the DLookup function to check a table to see if a user exist in there; if not refuse them access. The following is the code I am using but it seems to just pop up the "Error...
4
by: James Grant | last post by:
Hi Everyone, I've created a database (MS Access 2003) to help monitor staffing at my work. I now need to transcribe data from one table (tblPositions) into another (tblTeams) based on a common...
1
by: JPDeMoss | last post by:
First post here. I am trying to resolve an issue in MS Access using VBA where I am getting an error 13 type mismatch when using the DLookup function. I am looking for two values one string type...
7
by: alexrubio | last post by:
{{ Split from: Using DLookUp to prevent duplicates in Form }} Hi all, I was just tasked at tweaking the above macro and again I cannot find the right combination... I need to put an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.