🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #104930

Re: excel vba combobox 2 kolumny

#104930
From: Wojciech Malinowski
Date: Thu, 08 Nov 2012 19:52
155 lines
3989 bytes
W dniu czwartek, 8 listopada 2012 20:30:49 UTC+1 użytkownik Wojciech Malinowski napisał:
> W dniu czwartek, 8 listopada 2012 16:22:58 UTC+1 użytkownik IDKrzych napisał:
> 
> > W dniu 2012-11-08 08:22, Wojciech Malinowski pisze:
> 
> > 
> 
> > > Witam mam problem z odpowiednim wy�wietleniem danych w okienku combobox.
> 
> > 
> 
> > > Chcia�bym �eby by� jednakowy tabulator, czyli kolumna pod kolumn�.
> 
> > 
> 
> > >
> 
> > 
> 
> > > Pobieram dane z bazy i wy�wietlam je z comboboxie.
> 
> > 
> 
> > >
> 
> > 
> 
> > > .AddItem rst![Kategoria] & rst![Typ, nr katalogowy]
> 
> > 
> 
> > > rst.MoveNext
> 
> > 
> 
> > >
> 
> > 
> 
> > > Wiem �e mo�na to podzieli� BoundColumn.
> 
> > 
> 
> > > Ale nie wiem jak zrobi� �eby by�a kolumna pod kolumn�.
> 
> > 
> 
> > 
> 
> > 
> 
> > Zobacz tak:
> 
> > 
> 
> > 'ustaw kolumny
> 
> > 
> 
> > TwojCombo.ColumnCount = 2
> 
> > 
> 
> > 
> 
> > 
> 
> > 'w jakiej� p�tli wype�ni rekordami
> 
> > 
> 
> > TwojCombo.AddItem rst![Kategoria]
> 
> > 
> 
> > TwojCombo.List(TwojCombo.ListCount - 1, 1) = rst![Typ, nr katalogowy]
> 
> > 
> 
> > 
> 
> > 
> 
> > Pozdrawiam
> 
> > 
> 
> > -- 
> 
> > 
> 
> > IDKrzych
> 
> > 
> 
> > 
> 
> > 
> 
> > "Jakkolwiek b�dzie - b�dzie inaczej, ani�eli sobie wyobra�amy
> 
> > 
> 
> > - poniewa� mi�dzy Dobrem a Z�em znajdujemy si� w �yciu i w �wiecie
> 
> > 
> 
> > wielowymiarowym,
> 
> > 
> 
> > w kt�rym dokumentnie pomieszane jest Przypadkowe z Nieuchronnym."
> 
> > 
> 
> > (S. Lem 1999)
> 
> 
> 
> With ActiveSheet.ComboBox1
> 
> .Clear
> 
> Do
> 
> .AddItem rst![Kategoria]
> 
> .List(ComboBox1.ListCount - 1, 1) = rst![Typ, nr katalogowy]
> 
> rst.MoveNext
> 
> Loop Until rst.EOF
> 
> 
> 
> Mam coś takiego i tutaj pojawia się błąd:
> 
> .List(ComboBox1.ListCount - 1, 1) = rst![Typ, nr katalogowy]

Źle wpisałem sorry

With ActiveSheet.ComboBox1
.Clear
Do
.AddItem rst![Kategoria]
.List(.ListCount - 1, 1) = rst![Typ, nr katalogowy]
rst.MoveNext
Loop Until rst.EOF
End With

Tak działa, tylko w którymś rekordzie wywala mi błąd
.List(.ListCount - 1, 1) = rst![Typ, nr katalogowy]

Przeleci kilkaset rekordów i pojawi się błąd.
Dzięki za podpowiedź
Technical Details
Message-ID: <015b94b3-b3ac-4100-988a-9562a47f37e7@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!news.supermedia.pl!plix.pl!newsfeed2.plix.pl!feed.xsnews.nl!border-3.ams.xsnews.nl!ecngs!feeder2.ecngs.de!feeder.erje.net!eu.feeder.erje.net!news1.as3257.net!proxad.net!feeder1-2.proxad.net!209.85.216.87.MISMATCH!c7no11999308qap.0!news-out.google.com!gf5ni18188417qab.0!nntp.google.com!c7no12395388qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <7602a5f5-d45c-4a24-a948-4a51b72e12d4@googlegroups.com> <509bce51$0$1298$65785112@news.neostrada.pl> <6caad6da-bb27-4056-9e28-e0c8fdf38b9d@googlegroups.com>

Show Full Headers
Complete Article Headers
Received: by 10.224.207.66 with SMTP id fx2mr5490723qab.7.1352404365591;        Thu, 08 Nov 2012 11:52:45 -0800 (PST)
Received: by 10.236.180.134 with SMTP id j6mr1570104yhm.15.1352404365551; Thu, 08 Nov 2012 11:52:45 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!news.supermedia.pl!plix.pl!newsfeed2.plix.pl!feed.xsnews.nl!border-3.ams.xsnews.nl!ecngs!feeder2.ecngs.de!feeder.erje.net!eu.feeder.erje.net!news1.as3257.net!proxad.net!feeder1-2.proxad.net!209.85.216.87.MISMATCH!c7no11999308qap.0!news-out.google.com!gf5ni18188417qab.0!nntp.google.com!c7no12395388qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.vbasic
Date: Thu, 8 Nov 2012 11:52:45 -0800 (PST)
In-Reply-To: <6caad6da-bb27-4056-9e28-e0c8fdf38b9d@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.230.210.87; posting-account=mi5SHAkAAADQXfC54TeFmznXegfRuEDP
NNTP-Posting-Host: 89.230.210.87
References: <7602a5f5-d45c-4a24-a948-4a51b72e12d4@googlegroups.com> <509bce51$0$1298$65785112@news.neostrada.pl> <6caad6da-bb27-4056-9e28-e0c8fdf38b9d@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <015b94b3-b3ac-4100-988a-9562a47f37e7@googlegroups.com>
Subject: Re: excel vba combobox 2 kolumny
From: Wojciech Malinowski <wmalinowski1@gmail.com>
Injection-Date: Thu, 08 Nov 2012 19:52:45 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit