473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

combo DLookUp() Function

2 New Member
Hi,

I am making a database that will look up an employee in the main form and in the subform I can see their tasks. The subform is in a datasheet view and it has a combo box that allows you to select the task and then the adjacent text boxs fill up using the DLookUp function. I can't seem to make the DLookUp code work. I have

=DLookUP ("Field", "Table")

What else does this code need to work?

Any help is appreciated. Thank you in advance.

-Susana
Jun 18 '07 #1
3 3688
puppydogbuddy
1,923 Recognized Expert Top Contributor
Hi,

I am making a database that will look up an employee in the main form and in the subform I can see their tasks. The subform is in a datasheet view and it has a combo box that allows you to select the task and then the adjacent text boxs fill up using the DLookUp function. I can't seem to make the DLookUp code work. I have

=DLookUP ("Field", "Table")

What else does this code need to work?

Any help is appreciated. Thank you in advance.

-Susana
If you are looking up tasks for a specific employee, you forgot the where clause which will enable you to find the tasks for the employee whose SSN you selected from your combo box:

If SSN is text:
=DLookUP ("[TaskField]", "EmployeeTaskTable", "[SSN] = '" & Me!cboSSN & "'")

If SSN is numeric:
=DLookUP ("[TaskField]", "EmployeeTaskTable", "[SSN] = " & Me!cboSSN)
Jun 18 '07 #2
sbetancourt
2 New Member
If you are looking up tasks for a specific employee, you forgot the where clause which will enable you to find the tasks for the employee whose SSN you selected from your combo box:

If SSN is text:
=DLookUP ("[TaskField]", "EmployeeTaskTable", "[SSN] = '" & Me!cboSSN & "'")

If SSN is numeric:
=DLookUP ("[TaskField]", "EmployeeTaskTable", "[SSN] = " & Me!cboSSN)

Thanks for the help. I tried your suggestion but it is still not working. I am placing this in the control source field of the text box; is this the correct place for it? This is what I put:

The field is text so I used your first suggestion:
=DLookUp("[ReferenceMaterial]","tblTopic","[Topic] = '" & [Me]![cboTopic] & "'")
Jun 19 '07 #3
puppydogbuddy
1,923 Recognized Expert Top Contributor
Thanks for the help. I tried your suggestion but it is still not working. I am placing this in the control source field of the text box; is this the correct place for it? This is what I put:

The field is text so I used your first suggestion:
=DLookUp("[ReferenceMaterial]","tblTopic","[Topic] = '" & [Me]![cboTopic] & "'")
If you have a textbox, then you need to replace [Me]![cboTopic] with Me![YourTextboxName]....using the actual name of your textbox. I had assumed you had a combobox named cboTopic.
Jun 19 '07 #4

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

Similar topics

2
by: Dave N | last post by:
I have a combo box that displays the names of all the users in my "Users" table. I set the RowSource to a Query from the "User" and "Project" tables. I can select any name from the list and that...
2
by: David Mitchell | last post by:
I have a multiuser database which VBA to return the current users NT logon. The database has a table which contains the names of all users and a field called bmlogon which holds their NT logon. ...
4
by: N. Graves | last post by:
Hello; I have a table that is equipment. This table has a filed called Owner and that Owner filed is Looked up from a table called employee. and the query request the serial number of the...
1
by: Cillies | last post by:
Hi! I have a form that displays information using DLookUp. Now at present I am going into the query and entering criteria that I want the form to display. i.e. the form is for a sports team and...
1
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items...
2
by: c.kurutz | last post by:
Hello everyone. I have a problem with looking up pricing. Here is what I have so far: TABLES tblItems: itemid itemdescription itemunit (each, roll, square foot) location1price
4
by: Miguel | last post by:
I have synchronized combo boxes linking Account Type with Customer Names based on the template that Microsoft has in one of its samples databases. There are the appropriate relationships between...
3
by: chris | last post by:
I'm having trouble making this work: I have an unbound form with one unbound combo box field on it. The combo box's row source type is a query that has a username field and a security code...
0
by: Fred Zuckerman | last post by:
"Fred Zuckerman" <ZuckermanF@sbcglobal.netwrote in message news:... oops, typo, should be: Me.empname = dlookup("empname","tblEmployees","empID=" & empID)
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
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...
1
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...
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: 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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.