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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form with an unbound combo box.



 
 
Thread Tools Display Modes
  #1  
Old February 17th, 2010, 11:05 PM posted to microsoft.public.access.forms
JOSELUIS via AccessMonster.com
external usenet poster
 
Posts: 26
Default Form with an unbound combo box.

I´m trying to create a database but I take some examples from Inside Out 2007
by Viescas.I create a tblTeams ( TeamID,TeamName) tblPlayers(PlayerID) and
tblTeamPlayers(TeamID,TeamName,PlayerID). I create a form based on qryplayers
and I need a combobox "unbound?" called TeamName based on qlkqTeams but
when I try to open the combobox always shows the TeamID instead of TeamName.

In the sample database "Contacts" from Viescas the CompanyName is display
in the combobox CompanyID. I don´t really Know how this happen.Can anybody
give me an idea of how this works? Thanks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

  #2  
Old February 17th, 2010, 11:33 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Form with an unbound combo box.

On Wed, 17 Feb 2010 23:05:52 GMT, "JOSELUIS via AccessMonster.com"
u58123@uwe wrote:

In the sample database "Contacts" from Viescas the CompanyName is display
in the combobox CompanyID. I don´t really Know how this happen.Can anybody
give me an idea of how this works? Thanks


A Combo will display the first *non zero width* column in its rowsource.

The RowSource is where the combo gets its data from. This is typically a
Query; it can have many (up to ten, I believe) fields.

The ColumnCount property specifies how many of those columns are available.

The Bound Column defines which of the fields will become the combo's value
when a selection is made.

The Control Source is the name of the table field into which that value will
be stored (this can be blank, if the purpose of the combo is other than
storing a value in a table).

The ColumnWidths is a string of numbers separated by semicolons, defining the
display width of each column; if a column is of zero width, it's part of the
combo but not shown to the user.

For example, you could have a RowSource query like

SELECT CustomerID, LastName & ", " & FirstName AS CustName, CustAddr,
CustPhone, LastName, FirstName FROM Customers ORDER BY LastName, FirstName;

If the combo has ColumnCount = 4 only the ID, full name, address and phone
will be included in the combo's data.

The Bound Column would be 1 - so that the ID will be stored.

If the ColumnWidths property is

0";1";1.5";.5"

the user will see the customer's name when the combo is not dropped down (e.g.
"Vinson, John", and the address and phone will be after it when it is dropped
down. The CustomerID will not show because its width is zero.
--

John W. Vinson [MVP]
  #3  
Old February 18th, 2010, 11:34 PM posted to microsoft.public.access.forms
JOSELUIS via AccessMonster.com
external usenet poster
 
Posts: 26
Default Form with an unbound combo box.

Thank you vey much for your help. You really do it simple and clear so thank
you very much from Spain.

John W. Vinson wrote:
In the sample database "Contacts" from Viescas the CompanyName is display
in the combobox CompanyID. I don´t really Know how this happen.Can anybody
give me an idea of how this works? Thanks


A Combo will display the first *non zero width* column in its rowsource.

The RowSource is where the combo gets its data from. This is typically a
Query; it can have many (up to ten, I believe) fields.

The ColumnCount property specifies how many of those columns are available.

The Bound Column defines which of the fields will become the combo's value
when a selection is made.

The Control Source is the name of the table field into which that value will
be stored (this can be blank, if the purpose of the combo is other than
storing a value in a table).

The ColumnWidths is a string of numbers separated by semicolons, defining the
display width of each column; if a column is of zero width, it's part of the
combo but not shown to the user.

For example, you could have a RowSource query like

SELECT CustomerID, LastName & ", " & FirstName AS CustName, CustAddr,
CustPhone, LastName, FirstName FROM Customers ORDER BY LastName, FirstName;

If the combo has ColumnCount = 4 only the ID, full name, address and phone
will be included in the combo's data.

The Bound Column would be 1 - so that the ID will be stored.

If the ColumnWidths property is

0";1";1.5";.5"

the user will see the customer's name when the combo is not dropped down (e.g.
"Vinson, John", and the address and phone will be after it when it is dropped
down. The CustomerID will not show because its width is zero.


--
Message posted via http://www.accessmonster.com

  #4  
Old February 18th, 2010, 11:49 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Form with an unbound combo box.

On Thu, 18 Feb 2010 23:34:37 GMT, "JOSELUIS via AccessMonster.com"
u58123@uwe wrote:

Thank you vey much for your help. You really do it simple and clear so thank
you very much from Spain.


El gusto es mio.
--

John W. Vinson [MVP]
 




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 09:03 PM.


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