473,805 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DLookup syntax when there are two primary keys

Hi,

I have a table with two primary keys as below.

Table: Mouse
Primary key 1: MouseLine
Primary key 2: MouseNumber
Field 3: DateOfBirth

In a particular form, if I know MouseLine and MouseNumber, can I use
DLookup() to get DateOfBirth value? I know the syntax for DLookup()
when there is only one primary key in a table, but not when there are
two. Please help.

Thanks,
Tony

Dec 1 '05 #1
2 2221
Yes you can, something like:

dlookup("[DateofBirth]","table","Mous eline = " & chr(34) & Variable &
chr(34) & " and MouseNumber = " & Number)

You'll have to work out the quotes and stuff.

Dec 1 '05 #2
Got it. Thanks Dean.

Dec 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6498
by: Aleem | last post by:
I need help in writing a stored procedure on SQL Server 2000. Basically the stored procedure's primary task is to generate invoice records and insert the records in a invoice table. In order to generate the invoice records, I have an initial table which are basically Day Records. The task that I would like to complete is to select all records from that initial table and I guess put them into a temp table. Now that i have my temp table, I...
2
6126
by: Ronny Sigo | last post by:
Hello all, I want to perform a DLookup function with a variable (long) as critera. I know if it was a string this would be the correct syntax : Me!txtStad.Value = DLookup("", "tblPostnummers", " = '" & sBoxvalue & "'") Can anybody give me the correct syntax when boxvalue is a number (long) (In that case it would be called nBoxvalue. I don't seem to understand the delimiting :(:(:( Any help appreciated .... Thanks
7
2960
by: Ilan Sebba | last post by:
I am trying to add a record using SQL. My problem is that the primary keys are foreign keys, and these foreign keys are autonumbers. I therefore do not know the primary keys of the record I am trying to insert. I therefore do not think that I can use the sql "Insert Into" command. Here is a simplified illustration of my tables: tblFather NaturalKey1 NatuarlKey2
6
3473
by: LSemos | last post by:
I am trying to lookup phone numbers in a separate table based on the name in the current Tab control tblContacts has the fields: Name, Phone, Fax, and Email In my Form's Tab control, I have the fields: DVP, Phone, Fax and Email. In the On Click properties of the Phone field, I have the following: =DLookUp("","","='" & & "'")
2
3542
by: jwa6 | last post by:
syntax for a dlookup ok I give up! here is the error... ' Run-time error 3075 Syntax error in query expression '...' this is the code before that a contractor wrote. (I dont know if it ever worked....the table was wrong however)
6
2495
by: Ron | last post by:
Hi All, Was just wondering which is faster, a subreport or dlookup. I've got a report with either 5 subreports or lots of dlookups. The subreports generally have anywhere from 5 to 12 controls on them so if I don't do the subreport thing, I'm doing TONS of dlookups. Just wondering what others have found to be a faster way to do things. Is there even a faster way I'm unaware of yet than these 2 options?
115
6286
by: LurfysMa | last post by:
Most of the reference books recommend autonum primary keys, but the Access help says that any unique keys will work. What are the tradeoffs? I have several tables that have unique fields. Can I use them as primary keys or should I define an autonum primary key? One table has information about the 50 states in the US. The table looks like this:
1
391
by: Lee | last post by:
I have an orders form which has orderID as the primary key, it also has supplierID as a foreign key located on the form. I need a lookup field (that looks up the account number which is located in the suppliers table) on the orders form that syncs, so when the user moves through the different orders the supplierID changes along with there orders as well as the different account numbers related to the supplierID. A previous post suggested...
1
2917
by: colin-whitehead | last post by:
I have 2 tables tblReports primary key UPN, plus numeric fields Effort, Attain, etc tblComments numeric primary key ID & textfield Text In the Query I select each record from tblReports using UPN and for each of the numeric fields use DLookup to look up the Text in tblComments. the expression DLookUp("Text","tblComments","ID=" & tblReports!Effort)
0
9596
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,...
1
10366
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,...
0
10105
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
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
6876
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4323
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
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.