Thursday, 15 September 2011

forms - Microsoft Access 2010 - Foreign Key as Dropdown -


I have two tables that I display in a form:

tblUsers -> User_id, first name, last name, group_id

tblGroups - & gt; Group_id, groupName, groupDesc ​​

I can get the data that I want:

SELECT tblUsers.firstname, tblUsers.lastname, tblGroups.groupName from tblGroups INNER tblUsers Join TBLGroups [[Group_id] = tblUsers [Group_id];

But what I want is a form that shows a dropdown list for the user information and group but is not showing the name of the group and hence the group can change it for a specific user. Eg manager, editor etc ...

Thanks, Gareth

Wright -Click combo box (This is considered a combo box ...) and open the Properties window.

Set the source for the row:

  select group_id, set the number of columns to the tblGroups   

column to 2, Because you want the combo to store both the ID and the group name

the column width is "0; 2" (without quotation marks). This will essentially hide the ID because the column width of the ID field is 0.

Set the bound column to 1, because you want to bind the id column and the name of the group is not the column, because the group id is easy to ask.

Then you refer to the combo with me! To get MyComboboxName.Value Group ID

No comments:

Post a Comment