A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lookup to show on form



 
 
Thread Tools Display Modes
  #11  
Old June 30th, 2009, 04:27 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Lookup to show on form

Ah! I believe I understand now...

Let me try to paraphrase ... after selecting an item from the combobox,
you'd like to see the values that were in the other three columns (the ones
that show when the combobox is dropped-down, but disappear when you make
your selection).

First, just in case, remember that you do NOT want to store those values in
the table underlying the form ... display them, yes, store them, no.

To get a value from a combobox to display in a textbox on the form, use the
combobox's AfterUpdate event, and put something like (untested, adjust to
match your conditions/naming conventions):

Me!txtOneValue = Me!cboYourCombobox.Column(1)

The .Column(n) is 'zero-based', so you have to count the columns feeding
your combobox starting with 0, ... 1, ... 2, ...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Elizabeth" wrote in message
...
I have managed to move the combo box from the table to the form. It shows
all four columns in the drop down, but I still can't get them to display
on
the form. The column count is set to 4 and the SQL is "SELECT
[Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St], [Zips_US].[County] FROM
[Zips_US] ORDER BY [Zip];". Is it even possible to show all four fields
on
the form or am I just wasting my time?
--
Thanks for any help you can give!

Elizabeth


"Jeff Boyce" wrote:

see comments in-line below...

"Elizabeth" wrote in message
...
This is where I keep getting lost because I've never done anything like
this
before. I don't know what the SQL is or where to find it. Would that
be
the
"SELECT [Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St],
[Zips_US].[County]
FROM [Zips_US] ORDER BY [Zip];" that is listed as Row Source under the
lookup
tab of the table?


Yes ... and this is in the TABLE! Putting it there is the root cause of
all
the difficulty you're having!

I also can't find where to set the number of columns to display. I
have
the
column count as 4 in the lookup tab. When I go to the drop down list,
all
4
columns appear. It is after I have made the selection that I am having
trouble with.


And again, trying to do this is the table is discouraging, no? Read some
of
the other posts in this newsgroup on the subject and see WHY its
discouraged.

If you insist on doing it this way, you'll have to discover work-arounds.
Doing it the way suggested means no more work-arounds.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

--
Thanks for any help you can give!

Elizabeth






  #12  
Old June 30th, 2009, 08:04 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Lookup to show on form

On Tue, 30 Jun 2009 07:18:02 -0700, Elizabeth
wrote:

I have managed to move the combo box from the table to the form. It shows
all four columns in the drop down, but I still can't get them to display on
the form. The column count is set to 4 and the SQL is "SELECT
[Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St], [Zips_US].[County] FROM
[Zips_US] ORDER BY [Zip];". Is it even possible to show all four fields on
the form or am I just wasting my time?


Yes, you can.

Put four textboxes on the form, txtZip, txtCity, txtSt, txtCounty.

Set their control source properties to

=comboboxname.Column(0)
=comboboxname.Column(1)
=comboboxname.Column(2)
=comboboxname.Column(3)

respectively.
--

John W. Vinson [MVP]
  #13  
Old June 30th, 2009, 08:21 PM posted to microsoft.public.access.tablesdbdesign
Elizabeth
external usenet poster
 
Posts: 208
Default Lookup to show on form

Thank you so very much! That solved it. I knew it had to be possible somehow.

Elizabeth


"John W. Vinson" wrote:

On Tue, 30 Jun 2009 07:18:02 -0700, Elizabeth
wrote:

I have managed to move the combo box from the table to the form. It shows
all four columns in the drop down, but I still can't get them to display on
the form. The column count is set to 4 and the SQL is "SELECT
[Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St], [Zips_US].[County] FROM
[Zips_US] ORDER BY [Zip];". Is it even possible to show all four fields on
the form or am I just wasting my time?


Yes, you can.

Put four textboxes on the form, txtZip, txtCity, txtSt, txtCounty.

Set their control source properties to

=comboboxname.Column(0)
=comboboxname.Column(1)
=comboboxname.Column(2)
=comboboxname.Column(3)

respectively.
--

John W. Vinson [MVP]

  #14  
Old June 30th, 2009, 08:22 PM posted to microsoft.public.access.tablesdbdesign
Elizabeth
external usenet poster
 
Posts: 208
Default Lookup to show on form

I finally have all 4 columns showing. Thank you so much for all of your help.

Elizabeth


"Jeff Boyce" wrote:

Ah! I believe I understand now...

Let me try to paraphrase ... after selecting an item from the combobox,
you'd like to see the values that were in the other three columns (the ones
that show when the combobox is dropped-down, but disappear when you make
your selection).

First, just in case, remember that you do NOT want to store those values in
the table underlying the form ... display them, yes, store them, no.

To get a value from a combobox to display in a textbox on the form, use the
combobox's AfterUpdate event, and put something like (untested, adjust to
match your conditions/naming conventions):

Me!txtOneValue = Me!cboYourCombobox.Column(1)

The .Column(n) is 'zero-based', so you have to count the columns feeding
your combobox starting with 0, ... 1, ... 2, ...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Elizabeth" wrote in message
...
I have managed to move the combo box from the table to the form. It shows
all four columns in the drop down, but I still can't get them to display
on
the form. The column count is set to 4 and the SQL is "SELECT
[Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St], [Zips_US].[County] FROM
[Zips_US] ORDER BY [Zip];". Is it even possible to show all four fields
on
the form or am I just wasting my time?
--
Thanks for any help you can give!

Elizabeth


"Jeff Boyce" wrote:

see comments in-line below...

"Elizabeth" wrote in message
...
This is where I keep getting lost because I've never done anything like
this
before. I don't know what the SQL is or where to find it. Would that
be
the
"SELECT [Zips_US].[Zip], [Zips_US].[City], [Zips_US].[St],
[Zips_US].[County]
FROM [Zips_US] ORDER BY [Zip];" that is listed as Row Source under the
lookup
tab of the table?

Yes ... and this is in the TABLE! Putting it there is the root cause of
all
the difficulty you're having!

I also can't find where to set the number of columns to display. I
have
the
column count as 4 in the lookup tab. When I go to the drop down list,
all
4
columns appear. It is after I have made the selection that I am having
trouble with.

And again, trying to do this is the table is discouraging, no? Read some
of
the other posts in this newsgroup on the subject and see WHY its
discouraged.

If you insist on doing it this way, you'll have to discover work-arounds.
Doing it the way suggested means no more work-arounds.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

--
Thanks for any help you can give!

Elizabeth







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.