Skip to main content

AccessTr.neT


İlişkili Combobox ListBox

İlişkili Combobox ListBox

#1
Bir arkadaşımızdan gelen istek üzerine
daha önce gönderdiğim Country_Cıty_Town
tabloları ile ilgili olarak bir örnek ekte sunulmuştur.
Herkese kolay gelsin
.rar Country_City_Town_mdb.rar (Dosya Boyutu: 63,66 KB | İndirme Sayısı: 563)
okileturc, 18-03-2009 tarihinden beri AccessTr.neT üyesidir.
Cevapla
#2
Sn.okileturc Örnek İçin Teşekkürler.
Application Engineer
Cevapla
#3
Tşk, ama bazı konularda zayıfım, eleştirirseniz sevinirim
mesela ben 1. liste değerini form üzerine taşıyıp 2. listeyi
form üzerindeki denetimden bağlıyorum Oysa:
2. Listenin sorgu kriter alanında "Liste1.Column(0)"
kullanılabilir mi ? Lütfen bana bu konuda yardımcı olurmusunuz
Kabaca formun sağ tarafında bulunan denetimler kullanılmadan
bağlayabilirmiyiz
Tşk.
okileturc, 18-03-2009 tarihinden beri AccessTr.neT üyesidir.
Cevapla
#4
Kriterlere sadece ;

[Forms]![Form1]![Liste1]
[Forms]![Form1]![Liste2]

yazmanız bile yeterli.

Column yazmazsanız default olarak bağlı sütundaki (bound column) değeri alacaktır.
Farklı sütundaki değeri alacaksanız column(x) kullanabilirsiniz.
.rar Country_City_Town_Seruz.rar (Dosya Boyutu: 36,17 KB | İndirme Sayısı: 139)
Bildiğini bilenin arkasından git, bildiğini bilmeyeni uyar, bilmediğini bilene öğret, bilmediğini bilmeyenden kaç.
Konfüçyüs
Cevapla
#5
Çok tşk
Bu şekilde daha temiz oldu
Örneği güncelledim

yalnız sorgu kriterinde herşeye rağmen Column
kullanımını denedim :
[Forms]![Form1]![Liste2].Column(0)
hata verdi, Ynalış Column işlevi kullanımı diye
nasıl yazmalıyım ?

Tşk
.rar Country_City_Town_mdb.rar (Dosya Boyutu: 65,5 KB | İndirme Sayısı: 107)
okileturc, 18-03-2009 tarihinden beri AccessTr.neT üyesidir.
Cevapla
#6
Demek ki ben Column özelliğini sorgu kriteri olarak hiç kullanmamışım, çünkü bu hatayla karşılaşmamıştım.
Şimdi Access'in help'ine baktım, orada Column özelliğini sadece Macro ve Visual Basic kısmında kullanabilirsin diyor.
Alıntı:This property setting is only available by using a macro or Visual Basic

Bu durumda sorguda kriter olarak listbox'ın Column özelliğini kullanamıyoruz (boundcolumn haricinde),
bunun için sizin yaptığınız gibi arada gizli bir textbox kullanmak gerekiyor.

Alıntı:Column Property
You can use the Column property to refer to a specific column, or Column and row combination, in a multiple-column combo box or list box. Read-only Variant.

expression.Column(Index, Row)

expression Required. An expression that returns one of the objects in the Applies To list.

Index Required Long. A long integer that can range from 0 to the setting of the ColumnCount property minus one.

Row Optional Variant. An integer that can range from 0 to the setting of the ListCount property minus 1.

This property setting is only available by using a macro or Visual Basic. This property setting isn't available in Design view and is read-only in other views.

Remarks
Use 0 to refer to the first column, 1 to refer to the second column, and so on. Use 0 to refer to the first row, 1 to refer to the second row, and so on. For example, in a list box containing a Column of customer IDs and a Column of customer names, you could refer to the customer name in the second Column and fifth row as:

Forms!Contacts!Customers.Column(1, 4)

You can use the Column property to assign the contents of a combo box or list box to another control, such as a text box. For example, to set the ControlSource property of a text box to the value in the second Column of a list box, you could use the following expression:

=Forms!Customers!CompanyName.Column(1)
If the user has made no selection when you refer to a Column in a combo box or list box, the Column property setting will be Null. You can use the IsNull function to determine if a selection has been made, as in the following example:

If IsNull(Forms!Customers!Country)
Then MsgBox "No selection."
End If
Note To determine how many columns a combo box or list box has, you can inspect the ColumnCount property setting.
Bildiğini bilenin arkasından git, bildiğini bilmeyeni uyar, bilmediğini bilene öğret, bilmediğini bilmeyenden kaç.
Konfüçyüs
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task