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

DLookup "engine cannot find a record" when new record created.

gcoaster
117 100+
Hello!

I am having problem with DLookup Function

DLookup looks on form, and finds the combobox = cboFullName and then compares it to the column clientID in tblCLIENTS table. if they match, email is put in text box on form named clientEmail and the control source for that field is linked to a table tblCALLS and clientEmail column.

Not sure if DLookup is right for this.. anyways,

here is the Code

Expand|Select|Wrap|Line Numbers
  1. Me.clientEmail = DLookup("[email]", "tblCLIENTS", " clientID = cboFullName")
Problem is, when I cycle threw records and come to end and new is created.
VBA wont let me navigate to prev and complains " engine cannot find a record in the table 'tblCLIENTS' with the key matching field(s) 'clientFK'

thank you! you guys have helped me out immensely!
Dec 5 '07 #1
3 2463
missinglinq
3,532 Expert 2GB
I would assume that your combobox, which apparently holds the clients names, is based on your tblClients. If this is correct, and name and email address is, in fact, the same table, why not simply include the the email field in the combobox and reference it from there?

If the first field of the combobox holds the name and the second field holds the email address, this code should do the job:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboFullName_AfterUpdate()
  2.   Me.clientEmail = Me.cboFullName.Column(1)
  3. End Sub
Linq ;0)>
Dec 5 '07 #2
gcoaster
117 100+
Thanks bro!
that worked wonderfully,

Instead of placing code in
Private Sub Form_Current()

Placed here fixed it!

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboFullName_AfterUpdate()
  2. Me.clientEmail = Me.cboFullName.Column(2)
  3. End Sub

You are a genius!
and no way is your great great granpa an Ape!
Dec 5 '07 #3
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Dec 6 '07 #4

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

Similar topics

1
by: Just Me | last post by:
Table A contains a list of colors (example red, blue, green) Table B contains a variation of the colors in Table A (example light-red, medium-red, dark-red) To add a color variation to Table...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
4
by: cw | last post by:
(new to access / databases) I have just installed MS Access 2000 on an XP Sp2 based PC. Each time I try to create a new database or project I get a series of error messages. The main one is...
0
by: AA Arens | last post by:
I made a find record button on my form "company" (with field for name, phone nr, e-mail etc.). I expect that when I focus on one of the field, the "look in" of the find-record dialog box should...
7
by: Mathew Butler | last post by:
I'm investigating an issue I have when pulling data back from MS access I'm retrieving all rows from a column in a table of 5000 rows - accessing a column of type "memo" ( can be 65353 character...
7
by: gjoneshtfc | last post by:
Hello I want to search my database for a vehicle registration number but before i can search using the Find Record button i created i have to click in the registration field so that it is that...
3
by: eighthman11 | last post by:
Hi everyone. I inherited a database that had a user name ("field") in the user group not admins. This seemed to be fine for woking with the database because it was owned by user "field" and all...
0
by: s.amann | last post by:
Hello, I get the following error when I try to insert data into a table. "SQL1477N Table "<table-name>" cannot be accessed. " The table was created with NOT LOGGED INITIALLY The import is...
1
by: pauld | last post by:
Hello - I have created a simple web application in VS 2005/ASP.net 2.0 for a university department to track problems with a new website that I have built for them. The app consists of an Access...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
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...

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.