Thursday, February 16, 2012

change recordset position

Hi
Table Structure
company name
Phone No
Products
Example
Company Name Phone No Products
Sri balaji Enterprises 26554432 Advertising Agents
KarthicK Call Taxi 43215434 Call Taxi
Chitra Electricals 65437654 Electricals
Udhayam Call Taxi 24358901 Call Taxi
Annamalaiyar Advertising 67542317 Advertising Agents
Mathi Vehicles 23456789 Automobiles
Chennai Media 45326754 Advertising Agents
OUTPUT FORM
Here i am using 2 combo boxes. first box list out all distinct products.(i.e)
First Combo Box loads
Advertising Agents
Automobiles
Call Taxi
Eletricals
if i click the Advertising agents in first combo box the 2nd combox will
shows the company names of who are all dealing Advertising.
so the second combo box shows
Sri balaji Enterprises
Annamalaiyar Advertising
Chennai Media.
As the same when i click call taxi
Karthick Call taxi
Udhayam Call taxi
Its working...But my problem is..........
Next time when i click Advertising agents the second combo box have to show
Annamalaiyar Advertising(2nd record have 2 come to first)
Chennai Media.(3rd record have 2 come second)
Sri balaji Enterprises(1st record have 2 go last)
same when i click call taxi
Udhayam Call Taxi(2nd record have 2 come to first)
Karthick Call taxi(1st record have 2 go last)
i dont know how to do...if anybody knows help me to do that...
Thanks in advance.
Hi
"nila_vaanan" wrote:

> Hi
> Table Structure
> company name
> Phone No
> Products
> Example
> Company Name Phone No Products
> Sri balaji Enterprises 26554432 Advertising Agents
> KarthicK Call Taxi 43215434 Call Taxi
> Chitra Electricals 65437654 Electricals
> Udhayam Call Taxi 24358901 Call Taxi
> Annamalaiyar Advertising 67542317 Advertising Agents
> Mathi Vehicles 23456789 Automobiles
> Chennai Media 45326754 Advertising Agents
> OUTPUT FORM
> Here i am using 2 combo boxes. first box list out all distinct products.(i.e)
> First Combo Box loads
> Advertising Agents
> Automobiles
> Call Taxi
> Eletricals
> if i click the Advertising agents in first combo box the 2nd combox will
> shows the company names of who are all dealing Advertising.
> so the second combo box shows
> Sri balaji Enterprises
> Annamalaiyar Advertising
> Chennai Media.
> As the same when i click call taxi
> Karthick Call taxi
> Udhayam Call taxi
> Its working...But my problem is..........
> Next time when i click Advertising agents the second combo box have to show
> Annamalaiyar Advertising(2nd record have 2 come to first)
> Chennai Media.(3rd record have 2 come second)
> Sri balaji Enterprises(1st record have 2 go last)
> same when i click call taxi
> Udhayam Call Taxi(2nd record have 2 come to first)
> Karthick Call taxi(1st record have 2 go last)
> i dont know how to do...if anybody knows help me to do that...
> Thanks in advance.
>
You don't say how this listbox is being populated, but SQL Server does not
guaranteed and the order of records returned by a SQL query unless you
specify an ORDER BY clause on your statement. Check out the section on ORDER
BY in books online.
John

No comments:

Post a Comment