Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Access VBA

Модерирует : ShIvADeSt

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

dneprcomp



Silver Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
 
Create a lookup column (ADP)  
In a Microsoft Access project (Microsoft Access project: An Access file that connects to a Microsoft SQL Server database and is used to create client/server applications. A project file doesn't contain any data or data-definition-based objects such as tables and views.) connected to a Microsoft SQL Server 2000 database, you can add a lookup column. A lookup column displays values in another table's column that correspond to the lookup column's value. For example, a CustomerID column in an Orders table that is a foreign key (foreign key: One or more table fields (columns) that refer to the primary key field or fields in another table. A foreign key indicates how the tables are related.) to a Customers table. In this case, you want to display information about the customer, such as the customer name and address, rather than the number in the CustomerID column.
 
In the Database window, click Tables  under Objects, click the table you want to open, and then click Design on the Database window toolbar.  
Select an ID column, such as the foreign key column, and then click the Lookup tab.  
Define the lookup column by setting the following properties:  
In the Display Control, select the type of control you want to use for the lookup column in a form.  
Select Text Box to create a text box (text box: A control, also called an edit field, that is used on a form, report, or data access page to display text or accept data entry. It can have a label attached to it.).  
Select List Box to create a list box (list box: A control that provides a list of choices. A list box consists of a list and an optional label.) and make the next six properties available.  
Select Combo Box to create a combo box (combo box: A control used on a form that provides the combined functionality of a list box and a text box. You can type a value, or you can click the control to display a list and then select an item from that list.) and make all subsequent properties available.  
In the Row Source Type, enter the type of row source Tables/Views/Functions, Value List, or Field List).  
In the Row Source property, enter the name of the row source:  
If Row Source Type is set to Tables/Views/Functions, select a table, view, or function from the drop-down list box.  
Note  Although stored procedures are not listed, you can type the name of a single-statement stored procedure that does not modify data.
 
You can also click the Build button  to the right and use the Query Builder to create an SQL SELECT statement.  
If Row Source Type is set to Value List, enter the list of values, separated by semicolons, for example, "Small;Medium;Large" (without quotes).  
If Row Source Type is set to Field List, enter the list of fields from the query or SQL statement specified by the Row Source Type setting that you want used in the list box or combo box.  
In the Bound Column property, enter the number of the column you want bound to the underlying field for a bound multicolumn list box or combo box. This number is an offset: the first column is zero, the second column is 1, the third column is 2, and so on.  
In the Column Count property, enter the number of columns you want displayed in the list box or combo box.  
In the Column Heads property, select Yes if you want to display column headers.  
In the Column Widths property, enter the width of each column in inches, separated by semicolons, for example, 2;3. To hide the bound column from the display, use a width value of zero, for example 0;2.  
In the List Rows property, enter the maximum number of rows to display in the list box portion of a combo box.  
In the List Width property, enter the width of the list box portion of a combo box in inches.  
In the Limit To List, property, select Yes to restrict a combo box to displaying only values in the list. Select No to allow a user to enter text that doesn't match a value in the list.  
Click Save  to save changes and switch to Datasheet view to verify your results.  
Note  You can add more than one lookup column to a table.

Всего записей: 3920 | Зарегистр. 31-03-2002 | Отправлено: 20:20 05-06-2006 | Исправлено: dneprcomp, 21:15 05-06-2006
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Access VBA


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru