473,657 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

gcoaster
117 New Member
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 2477
missinglinq
3,532 Recognized Expert Specialist
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 New Member
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 Recognized Expert Specialist
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
1877
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 B, I want it to open a find record dialog box before it opens the form so that you can locate the main color you are going to enter the variations for. The form should then open with the information from Table A already preloaded (or a dialog box...
12
12928
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 we prevent this from happening? Thanks. ming
4
1576
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 "The MS Jet database engine cannot find the input table or query 'Hisago1105_sub'. Make sure it exists and that its name is spelled correctly.
0
1532
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 be set to the field, but instead of that it is set to the form name (company). To avoid it I have to set it manually to the focussed field. How to have it default set to the focussed field as I used to find records containing cetrtain data in the...
7
12175
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 long) . I'm pulling the data back using ODBC. Details are: Microsoft Access Driver 4.00.6306.00 Jet 4.0 release level that is currently installed (Msjet40.dll ) "Microsoft Jet Engine Library" 4.0.9025.0 After 291 rows are retreived I am...
7
9445
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 one that is being searched. Is there any way to just click the button and by default it searches the registration field? Or... is there a way where I can get the user to type in the registration number in a text field then click a command button...
3
4077
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 the tables and queries where owned by user "field". I did a compact database yesterday and now all the tables that are linked have an owner of "engine". And all the tables I created when signed in as "field" don't even show up. Like I said I...
0
5374
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 done by a program written in C and using embedded SQL. It starts with ALTER TABLE myTable ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE. Then I prepare the statement and the inserts are done within a loop
1
3266
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 2003 db configured to use the aspnet role provider (via the "unreleased" Access Providers) and it also has a "bugs" table that stores the data relevant to problems reported by users. Users login via an asp.net login control and from there can...
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8820
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.