473,461 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with Dlookup syntax

I have a form based on tbl_Wedding_Products which contains a combo box cboPID which looks up product details in tbl_Products. I am trying to display the cost of the product (in text box txtUBP), held in tbl_Products, for the product selected in cboPID but it doesn't work. Can you sort my syntax out please?

txtUBP = DLookup("[Product Buying Cost]", "tbl_Products", " [tbl_Products]![Product ID] ='" & [cboPID] & "'")
Sep 4 '07 #1
5 1467
lee123
556 512MB
why dont you try this:

txtubp=dlookup("txtubp","tblproducts"."productid=" & cbopid")

i think this will work!

lee123
Sep 4 '07 #2
lee123
556 512MB
oops i goofed i put quotes in a place it not suppose to be

try this:

Expand|Select|Wrap|Line Numbers
  1. txtubp=dlookup("txtubp","tblproducts"."productid=" & cbopid)
sorry this will work .

lee123
Sep 4 '07 #3
lee123
556 512MB
i can't type this morning there is no period in this sorry(use a comma after tblproduct)

lee123
Sep 4 '07 #4
Hurrah - thank you - you've stopped me going mad!
Sep 4 '07 #5
lee123
556 512MB
Glad i Could help.

lee123
Sep 4 '07 #6

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

Similar topics

1
by: Thelma Lubkin | last post by:
I am still struggling with trying to match a user supplied string with strings in a field of a table, where spaces are to be ignored. Arno suggested that I use the Dlookup function, but I...
4
by: basstwo | last post by:
I have a field with a serial number in it. I want to use Mid to extract the 4th and 5th characters, use them to lookup a value on a small lookup table, and use the info from that table to fill in...
1
by: Tony Ciconte | last post by:
I am using Acc97 and trying to get the following instruction to work in the OnOpen event of a report: DLookup("", "tblTempRevenueByFY", DatePart("m", ) = 1) The table tblTempRevenueByFY...
2
by: Diana | last post by:
I thought I had this process pretty well down pat, but I'm getting a syntax error on the following code: *****Code***** 'Check for users - can't get this to work... Dim strUser As String ...
6
by: bjaj | last post by:
Hi How do I use a boolean criterian with the funktion DLookup ? I know the syntax for strings, numeric and date as follows For numerical values: DLookup("FieldName" , "TableName" ,...
8
by: MLH | last post by:
The following SQL returns PRECISELY what I want: SELECT TOP 1 tblCorrespondence.CorrespID, tblOutboundTypes.OTypDescription, tblCorrespondence.OutDate, tblCorrespondence.VehicleJobID,...
2
by: Eric | last post by:
Can any one please tell me the syntax is correct Me.List17=DLookUp(,,="" And =") Thanks,
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...
2
by: Lumpy | last post by:
Hi all, I am having a problem with a line of code in access vba. I am trying to use the DLookup function to check whether or not a record already exists with a dealer name. Once I know if it...
30
by: DH22 | last post by:
Access 03 I'm currently having an issue using Dlookup when trying to reference a query (criteria syntax) Currently I have 1 table, which is L_Emps (which contains Employee_ID as my key...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.