By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Dlookup... ARRRGGGHH!

P: n/a
Hi,
Am simply trying to populate a text box in the input form with a value
once a selection is made from a drop down box.

Table Name: BDMAMList

BDM UserID

Joe GRXCVF
Adam HNANDL

So if the drop down box selects Joe, then a text box is automatically
populated with GRXCVF.

Is Dlookup the correct function to be using for this?

Cheers,
Adam

Nov 15 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ab*******@aapt.net.au wrote:
Hi,
Am simply trying to populate a text box in the input form with a value
once a selection is made from a drop down box.

Table Name: BDMAMList

BDM UserID

Joe GRXCVF
Adam HNANDL

So if the drop down box selects Joe, then a text box is automatically
populated with GRXCVF.

Is Dlookup the correct function to be using for this?

Cheers,
Adam
I can be, but since you are already retrieving the BDM field for your ComboBox
RowSource it would be easier and more efficient to include the UserID field in
the ComboBox RowSource as a hidden column and then just set the ControlSource of
your other TextBox to...

=ComboBoxName.Column(1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Nov 15 '06 #2

P: n/a
Thanks Rick, but how do I hide the column in the combo box?

Rick Brandt wrote:
ab*******@aapt.net.au wrote:
Hi,
Am simply trying to populate a text box in the input form with a value
once a selection is made from a drop down box.

Table Name: BDMAMList

BDM UserID

Joe GRXCVF
Adam HNANDL

So if the drop down box selects Joe, then a text box is automatically
populated with GRXCVF.

Is Dlookup the correct function to be using for this?

Cheers,
Adam

I can be, but since you are already retrieving the BDM field for your ComboBox
RowSource it would be easier and more efficient to include the UserID field in
the ComboBox RowSource as a hidden column and then just set the ControlSource of
your other TextBox to...

=ComboBoxName.Column(1)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Nov 15 '06 #3

P: n/a
ab*******@aapt.net.au wrote:
Thanks Rick, but how do I hide the column in the combo box?
Look at the ColumnWidths property of the ComboBox. This will be a semi-colon
delimited list of widths for each column. To hide a column just use a width of
zero.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Nov 15 '06 #4

P: n/a
ab*******@aapt.net.au wrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
Hi,
Am simply trying to populate a text box in the input form with
a value once a selection is made from a drop down box.

Table Name: BDMAMList

BDM UserID

Joe GRXCVF
Adam HNANDL

So if the drop down box selects Joe, then a text box is
automatically populated with GRXCVF.

Is Dlookup the correct function to be using for this?

Cheers,
Adam
much simpler is to modify the combobox to hold the two values,
(if you make the width of the second column 0" it will not be
seen) and use a single line of code in the combobox_AfterUpdate
event to stuff the value of the second column into the textbox.

me.textbox.value = me.combobox.column(1)

replace textbox and combobox with the correct identifiers in
your form.
Note: the 1 is not an error, the first column is 0.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.