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

Combo box look up trouble

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 field. I want to add another unbound text box to the
form and have the security code populate that field with the correct
security code based on the user from the combo box. I'm not sure if
DLookup will do it? I'm not sure how to write the dlookup function.
If someone could give me the generic code or a way to do this, I will
substitute the actual names.

Any help would be greatly appreciated!

Thank you!

Chris

Jan 25 '07 #1
3 1555
chris wrote:
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 field. I want to add another unbound text box to the
form and have the security code populate that field with the correct
security code based on the user from the combo box. I'm not sure if
DLookup will do it? I'm not sure how to write the dlookup function.
If someone could give me the generic code or a way to do this, I will
substitute the actual names.

Any help would be greatly appreciated!

Thank you!

Chris
Just set the ControlSource of the TextBox to...

=ComboBoxName.Column(1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 25 '07 #2

Thank you for the input, but it didn't work.

Column 1 in the query is the user name. Coulmn 2 is the security code.
Even when I changed the ControlSource to:
=ComboBoxName.Column(1)
it didn't work.

I changed the column count for the combo box to 2 and it now shows both
fields from the query in the drop down of the combo box, but it still
won't bring the security code to the unbound text box.

Any other ideas? Am I doing something wrong?

Thanks again.
On Jan 25, 2:31 pm, "Rick Brandt" <rickbran...@hotmail.comwrote:
chris wrote:
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 field. I want to add another unbound text box to the
form and have the security code populate that field with the correct
security code based on the user from the combo box. I'm not sure if
DLookup will do it? I'm not sure how to write the dlookup function.
If someone could give me the generic code or a way to do this, I will
substitute the actual names.
Any help would be greatly appreciated!
Thank you!
ChrisJust set the ControlSource of the TextBox to...

=ComboBoxName.Column(1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com- Hide quoted text -- Show quoted text -
Jan 25 '07 #3
chris wrote:
Thank you for the input, but it didn't work.

Column 1 in the query is the user name. Coulmn 2 is the security
code. Even when I changed the ControlSource to:
=ComboBoxName.Column(1)
it didn't work.

I changed the column count for the combo box to 2 and it now shows
both fields from the query in the drop down of the combo box, but it
still won't bring the security code to the unbound text box.

Any other ideas? Am I doing something wrong?
The column numbering begins with zero so Column(1) is the second column.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 25 '07 #4

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

Similar topics

6
by: William Bradley | last post by:
I have a production table and its accompanying form. There can be up to ten ingredients in what is produced. The ingredients are obtained from the incoming goods table which supplies the two...
1
by: Arun | last post by:
Hi Group, I was trying to link a combo box with a list control and having some trouble with that. Could anyone please help me with that. Here's the example of the scenario. Combo Box ;-...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
0
by: Jeremy Wallace | last post by:
Folks, Here's a write-up I did for our developer wiki. I don't know if the whole rest of the world has already figured out how to do this, but I hadn't ever seen it implemented, and had spent a...
3
by: fstenoughsnoopy | last post by:
Ok the complete story. I have a Contact Table, Query and Form, that are used to input and store the contact info for customers. They have FirstName, LastName and Address as the primary key...
2
by: docsix | last post by:
I am having trouble populating a combo box in a subform. Currently I have two combo boxes on a single form that works. This is my current setup: Table:Facilities - FacilityID ... FacilityType 1...
2
by: buddyr | last post by:
Hello, I am having trouble with two combo boxes working together. two tables table1 table2 table1 fields -number and name table 2 fields -code and number ...
5
by: wajedali | last post by:
Hi I am having trouble rendering a combo box with icon near the text. Below is a simple code which demonstrates my problem. import java.awt.Component; import java.util.HashMap; import...
10
by: bettyboo | last post by:
Hi all I got some really useful advice from here with my last question so I'm back for more! Only my second post so please bear with me - I'm very new to this so this will probably not be as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.