tulnetdotcom
Posts: 26
|
Posted: 02/12/2004, 3:41 AM |
|
I have big inventory database.
I need to create search form in which I can select field in drop down list and search the value specified in text box.
Is that possible?
Please help me!!!!!!!!!!
|
|
|
peterr
Posts: 5971
|
Posted: 02/12/2004, 5:10 PM |
|
Of course this is possible. Actually, this is what CCS was created to do
Our "Employee Directory" Tutorial explains how to create exactly such an application, step-by-step.
Take a look at the final result: http://docs.codecharge.com/studio/html/QuickStart/Creat...ewTestProj.html
You can see there a search form with the drop-down list and the text box, exactly as you asked
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
tulnetdotcom
Posts: 26
|
Posted: 02/12/2004, 11:16 PM |
|
peterr, thanks for the reply.
I had look at the "Employee Directory" example. But I want slightly different solution.
I will explain you what I want, Suppose I have access database of following fields (columns)-
SrNo
UserName
MachineSrNo
MachineConfig
Dept
Location
... Now I want to build search form in following way:
Search in -> listbox for selecting database fields(columns) : textbox for keyword
I think you will understand the situation now.
waiting for the reply !!!!!!!!!!
|
|
|
peterr
Posts: 5971
|
Posted: 02/12/2004, 11:34 PM |
|
You can create a ListBox that utilizes a "List Of Values" instead of a database. Then list in the "Data Source" property all the fields that you'd like to display. For example:
SrNo;SrNo;UserName;UserName;MachineSrNo;MachineSrNo;MachineConfig;MachineConfig;Dept;Dept;Location;Location
This should be all needed for the Search form.
As for the Grid, you might need to create an SQL statement that would utilize all these parameters. For example:
SELECT * FROM Table WHERE
(ListboxName='{SrNo}' AND SrNo LIKE '%{TextBoxName}%') OR
(ListboxName='{UserName}' AND UserName LIKE '%{TextBoxName}%') OR
(ListboxName='{MachineSrNo}' AND MachineSrNo LIKE '%{TextBoxName}%') OR ...etc.
(replace Table with the real table name, ListBoxName with the name of your listbox and TextBoxName with the name of your textbox.)
I haven't tested this. It's just an idea of how I would approach it, but should work.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
peterr
Posts: 5971
|
Posted: 02/12/2004, 11:43 PM |
|
Oops, I already see a mistake. The SQL probably should be:
SELECT * FROM Table WHERE
({ListboxName}='SrNo' AND SrNo LIKE '%{TextBoxName}%') OR
({ListboxName}='UserName' AND UserName LIKE '%{TextBoxName}%') OR
({ListboxName}='MachineSrNo' AND MachineSrNo LIKE '%{TextBoxName}%') OR ...etc.
And, you would also need to create and configure an SQL parameter to match the {ListboxName} :
Variable Name: ListboxName
Parameter Source: ListboxName
Parameter Type: URL
(replace ListBoxName with the name of your listbox)
Again, I cannot vouch for the code, just trying to point you in the right direction.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
tulnetdotcom
Posts: 26
|
Posted: 02/13/2004, 3:39 AM |
|
Hi, Peterr,
I tried that solution but getting some error while testing above SQL query
Something like : Error: No value given for one or more required parameters. (Microsoft JET Database Engine)
What could be the problem??????????
|
|
|
peterr
Posts: 5971
|
Posted: 02/13/2004, 9:54 AM |
|
Well, I cannot write or debug your application. Again - this was just a tip.
Though if you purchase CCS our support should be able to help you further.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|