Home All Groups Group Topic Archive Search About
Author
13 Mar 2007 7:16 PM
Hemang
Hello

I need to create a search form which allows the user to search for records
using multiple criteria, and then they can select that record and when
clicked ok, that particular record to be displayed in the main form.

I have the main form, I need to implement the search feature for that (its a
windows based app).

Any samples would be very helpful.

Thanks

Author
13 Mar 2007 11:41 PM
Earl
You could:

Use a combo for search criteria;
Use a textbox for search string;
Use a button to fire the search;
Use a parameterized query to retrieve the results -or- use multiple queries
depending upon the criteria selected in the combo;
Use a listbox for a listing of the records retrieved, with the primary key
as the valuemember;
When the user clicks on the record desired, use the primary key to retrieve
the details of the record;
Display the detail results in the controls on your form.

Show quoteHide quote
"Hemang" <Champ@nospam.nospam> wrote in message
news:4ECF5894-E4C6-415E-8C30-4014BAF95543@microsoft.com...
> Hello
>
> I need to create a search form which allows the user to search for records
> using multiple criteria, and then they can select that record and when
> clicked ok, that particular record to be displayed in the main form.
>
> I have the main form, I need to implement the search feature for that (its
> a windows based app).
>
> Any samples would be very helpful.
>
> Thanks
>
>
Are all your drivers up to date? click for free checkup

Author
14 Mar 2007 12:33 AM
RobinS
If you want to display the details on the main form, there are many ways to
do that.

You can create public properties on your main form for those settings, and
set them from your search form.

You can pass an instance of the main form into the search form, and put the
data anywhere in the main form you want to.

When I did this, I actually closed my main form and brought up the search
form. I didn't want them mucking around with the main form anyway. Then
when they return to the main form, I instantiate it and pass in the
information (you could use a structure or class or string if there's only
one field) and then show it. So my main form has a default constructor, as
well as one that takes input(s).

Robin S.
--------------------------

Show quoteHide quote
"Earl" <brikshoe@newsgroups.nospam> wrote in message
news:uBdSLkcZHHA.4368@TK2MSFTNGP06.phx.gbl...
> You could:
>
> Use a combo for search criteria;
> Use a textbox for search string;
> Use a button to fire the search;
> Use a parameterized query to retrieve the results -or- use multiple
> queries depending upon the criteria selected in the combo;
> Use a listbox for a listing of the records retrieved, with the primary
> key as the valuemember;
> When the user clicks on the record desired, use the primary key to
> retrieve the details of the record;
> Display the detail results in the controls on your form.
>
> "Hemang" <Champ@nospam.nospam> wrote in message
> news:4ECF5894-E4C6-415E-8C30-4014BAF95543@microsoft.com...
>> Hello
>>
>> I need to create a search form which allows the user to search for
>> records using multiple criteria, and then they can select that record
>> and when clicked ok, that particular record to be displayed in the main
>> form.
>>
>> I have the main form, I need to implement the search feature for that
>> (its a windows based app).
>>
>> Any samples would be very helpful.
>>
>> Thanks
>>
>>
>
>
Author
15 Mar 2007 9:04 PM
Hemang
Thank you Earl & Robin

Both of your explanation are helpful.  However although in theory these
concepts sounds excellent to work, I don't have the skills to code that in
c#, and thus was looking for a live example which I can learn from and
implement in my app.  (Finishing an old project which I had undertaken,
coding is not my primary skill set)

Thanking you in anticipation.
..


Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:8PSdnbc2TeB632rYnZ2dnUVZ_hOdnZ2d@comcast.com...
> If you want to display the details on the main form, there are many ways
> to do that.
>
> You can create public properties on your main form for those settings, and
> set them from your search form.
>
> You can pass an instance of the main form into the search form, and put
> the data anywhere in the main form you want to.
>
> When I did this, I actually closed my main form and brought up the search
> form. I didn't want them mucking around with the main form anyway. Then
> when they return to the main form, I instantiate it and pass in the
> information (you could use a structure or class or string if there's only
> one field) and then show it. So my main form has a default constructor, as
> well as one that takes input(s).
>
> Robin S.
> --------------------------
>
> "Earl" <brikshoe@newsgroups.nospam> wrote in message
> news:uBdSLkcZHHA.4368@TK2MSFTNGP06.phx.gbl...
>> You could:
>>
>> Use a combo for search criteria;
>> Use a textbox for search string;
>> Use a button to fire the search;
>> Use a parameterized query to retrieve the results -or- use multiple
>> queries depending upon the criteria selected in the combo;
>> Use a listbox for a listing of the records retrieved, with the primary
>> key as the valuemember;
>> When the user clicks on the record desired, use the primary key to
>> retrieve the details of the record;
>> Display the detail results in the controls on your form.
>>
>> "Hemang" <Champ@nospam.nospam> wrote in message
>> news:4ECF5894-E4C6-415E-8C30-4014BAF95543@microsoft.com...
>>> Hello
>>>
>>> I need to create a search form which allows the user to search for
>>> records using multiple criteria, and then they can select that record
>>> and when clicked ok, that particular record to be displayed in the main
>>> form.
>>>
>>> I have the main form, I need to implement the search feature for that
>>> (its a windows based app).
>>>
>>> Any samples would be very helpful.
>>>
>>> Thanks
>>>
>>>
>>
>>
>
>
Author
15 Mar 2007 9:08 PM
Hemang
Thanks Earl & RobinS

Although the theory does indeed help, I don't have the skill set to put that
into c# code.  I had written the app in c# a while back and now I need to
implement a search module, and thus the request for a sample app, by which I
can look & learn.

Thanking in anticipation.




Show quoteHide quote
"Hemang" <Champ@nospam.nospam> wrote in message
news:4ECF5894-E4C6-415E-8C30-4014BAF95543@microsoft.com...
> Hello
>
> I need to create a search form which allows the user to search for records
> using multiple criteria, and then they can select that record and when
> clicked ok, that particular record to be displayed in the main form.
>
> I have the main form, I need to implement the search feature for that (its
> a windows based app).
>
> Any samples would be very helpful.
>
> Thanks
>
>

Bookmark and Share