473,320 Members | 1,939 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.

RunTime error: 3075 - Dlookup Issue

29
Hello Experts,

I'm about to go grey with this dlookup statement:

I'm trying to run a dlookup statement, I have the correct expression string, etc. but when I run it under the Immediate window for testing I'm getting the runtime error.

Scanerio:

I'm calling an associated Price value (Currency) for a Code (text) from a Query in order to have an auto population in the fields; here is the code:

Expand|Select|Wrap|Line Numbers
  1.  Private Sub CPTcode_AfterUpdate()
  2.     Charge = DLookup("Charge", "Q_CPT-phys test1", "CPTcode= '& CPTcode'")
  3. End Sub 
It only populates if i replace the "& CPTcode" with an actual value. This is pulling from the same Subform.

Please Help

Adigga1
Nov 14 '08 #1
3 11225
Try this instead.

Expand|Select|Wrap|Line Numbers
  1. Charge = DLookup("Charge", "Q_CPT-phys test1", "CPTcode= '" & CPTcode & "'")
I have issues with DLookups too, it's not just you =)
Nov 14 '08 #2
adigga1
29
mandanarchi,


Thank you for your suggestion; I will try this code and follow-up with the results.

Adigga1


It ran Successfully!! Thank you
Nov 14 '08 #3
missinglinq
3,532 Expert 2GB
Is CPTcode a Text or Numeric Datatype? The syntax varies accordingly.

For Numeric CPTcode:
Expand|Select|Wrap|Line Numbers
  1. Me.Charge = DLookup("Charge", "Q_CPT-phys test1", "CPTcode= "& Me.CPTcode)
  2.  
For Text CPTcode:
Expand|Select|Wrap|Line Numbers
  1. Me.Charge = DLookup("Charge", "Q_CPT-phys test1", "CPTcode = '" & Me.CPTcode & "'")
  2.  
Welcome to Bytes!

Linq ;0)>
Nov 14 '08 #4

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

Similar topics

8
by: swathky | last post by:
I've tried mutiple things but no go -- (sorry this is so long) I'm collecting a 5 digit number in an input box function and all works fine until a number is passed that doesn't exist in the...
1
by: JMCN | last post by:
I have an ftp program that i inherited and i tried to modify it to ftp over my file however, i receive an error message : run-time error '3075 syntax error (missing operator) in query expression...
3
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
3
by: injanib via AccessMonster.com | last post by:
Hello Access Monsters, I have a table with three columns. "CostCenter", "ProjectNumber", "GLCode" On my form I have three texboxes, "txtCostCenter", "txtProjectNumber" and "txtGLCode". the...
5
by: MARTINQC | last post by:
"SELECT ., .Category INTO tblSiteGroupActiveTicketRawData FROM .Base = 'AAAA') OR (.Base = 'BBBB')) AND (.Status != 'Closed');" Above SQL string fails with a runtime error 3075 syntax error...
1
by: BobbyDazzler | last post by:
tblproduct (simplified) productid(pk) productcode productcost productprice warrantycode any warranty claim is invoiced out as the original productcode but with a w in front e.g. original...
1
by: kickergirl | last post by:
I recently created a database in Access 2000 that has been distributed to multiple people using various versions of Access. Each person is using it as a standalone database. The database has...
5
by: rolltide | last post by:
I've seen many similar threads, but despite repeated efforts I cannot figure out my problem. I am running Access 2003, VB 6.5, Office XP Pro. Code excerpt is below (you can see where I've tried...
3
by: Sophiecarr | last post by:
Hi, I am trying to use DLookup in relation to input from an option group. The option group has 3 options (Course Title), in a 'Core Modules' table, I have set the primary field to be the 'Course...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.