TZF - Sorting in TTzComboBoxes
Jerry Mallett <[email protected]> Sun, 31 Aug 2003 14:38:25 +0000
| Newsgroups | gmane.comp.lang.delphi.topaz |
|---|---|
| Message-ID | <[email protected]> |
HELP........Struggling NEWBIE AGAIN !!!!!!!!!!!!!
Trying to build his first decent application to help with my business..
Here's hoping I can explain my problem properly......
I have two Forms.
one which contains a QuickReport ( and thats a whole other story lol )
while the other one is full of data entry fields.
The data entry one is to facilitate in house quotations and contains a
number of
TTzComboBox's. Each one linked to a specific field in my products
database.
My products need to be sorted when I click the dropdown list icon and I
tried using the "product.sorted" command but it then requires two clicks
to
drop the list and when the list drops creates two copies of each
product.
I'm using two events for the TTzComboBoxes... OnChange & OnEnter and
they
look like so.............
procedure TQuoteForm.mboardEnter(Sender: TObject);
// Motherboard selection
Var pd, pc : string;
// pd = Product Description & pc = Product Code
begin
DataMod.Products.Active := True;
mboard.sorted := True;
// Tried to sort dropdown list here with above line and it
// does sort it but it produces two of everything and I
// have to click twice to drop the list.
mboard.Items.Add('No Selection'); // Add a "No Selection" option
While NOT DataMod.Products.dEOF Do
Begin
If Trim(DataMod.Products.GetCField('PRODGROUP')) = 'PROD_MBRD' Then
Begin
pd := Trim(DataMod.Products.GetCField('PRODDESC'));
pc :=
LPad(IntToStr(DataMod.Products.GetLongField('ProdCode')),4);
UnitPrice := DataMod.Products.GetRealField('oneoff');
mboard.Items.Add(pd+' - ('+pc+') £'+SReal(UnitPrice,6,2));
End;
DataMod.Products.skip(1);
End;
DataMod.Products.Active := False;
end;
procedure TQuoteForm.mboardChange(Sender: TObject);
Begin
// here we extract the revelant info like product name, code,
// net price etc.,
mboard.sorted := True;
// Tried to sorth the dropdown list with the above line here but it
// won't sort
end;
I was trying to use a TzVFile and sort it prior to dropping this list
but I'm finding this impossible to do as well.
I saw Marie Vihonsky's reference to it, (TzVFile), in a recent
posting....
but I'm afraid it went way way over my head as did Chris Morgan's.
Sorry guys.....but I'm a little long in the tooth and the old grey brain
cells
are fading fast.......I'm 49, 50 come October, and I'm a self taught
computer
technician. Left school at 15 and had a number of jobs over the years.
Started
repairing, Building and upgrading PC's in 1985 and own my own repair
shop.
In what little free time I have I try to get to grips with as wide a
range of
software products as I can and have mastered quite a few.
Programming tho is a little more time consumming and if you leave if for
a few
weeks it's hard to remember where you left of...
Why am I telling you all this??????
So that you'll go easy on me of course...........lmao
Many thanks for the help in advance...
--^----------------------------------------------------------------
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]
TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
--^----------------------------------------------------------------