Source language: Translate to:

Searching through Database and Displaying Results

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Searching through Database and Displaying Results

Postby radz123 » Tue Aug 18, 2015 1:38 am

Good Day, NeoSofters

I am trying to make a store management software for my shop and I was able to setup all the basic stuff
but now, when I try to setup the actual order-taking page. I can't display the proper search results after I typed in to an editbox.

Can someone help me on how to display search results from the database?
Like, I want to type in a editbox and then display the results on another label object?

Anyone knows how to do this?
radz123
 
Posts: 7
Joined: Tue Jul 21, 2015 10:17 pm

Re: Searching through Database and Displaying Results

Postby stu » Tue Aug 18, 2015 6:24 am

What about one Text box (textbox1) with some sort of...

Code: Select all
dbpexecsql "DB" "SELECT * FROM tblSomething WHERE search_field LIKE [#39]%[textbox1]%[#39]" ""


...in the Text change action. At the time you have a grid with the tblSomething, it'll filter real time according to your search, then you could implement a Double click in the grid that can take you to a page displaying the whole record details.
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: Searching through Database and Displaying Results

Postby radz123 » Tue Aug 18, 2015 8:01 am

Thank you for your response!

Sorry for the late reply. I have implemented a seemingly "different" method. I employed the DBFind and displayed that on a Listbox.. So basically heres what I did so far.. (Sorry, I'm not so good with programming and stuff)

1. I used DBFind and displayed results on Listbox
2. Stored Variable gets Stored on a Temporary DB Record
3. A rectangle object shows the current rows for the Temporary DB Record
4. Now when I press a Sum button it does the Math and puts that on a variable (Total Items purchased)
5. I then display that variable as text.. (To Pay)

--- Now, additional questions on DBPro

1. Can we pre-calc variables before putting them on DB Record?
*What I mean is that, Can I implement VAT or Discounts for example and do Math before importing Var to Record?
2. I am not sure how to use the DB Invoice report.. I am thinking of implementing a different approach.. Can you guide me on a much better approach in generating invoices with Invoice Number generated?
radz123
 
Posts: 7
Joined: Tue Jul 21, 2015 10:17 pm

Re: Searching through Database and Displaying Results

Postby Neosoft Support » Tue Aug 18, 2015 11:06 am

1. Can we pre-calc variables before putting them on DB Record?
*What I mean is that, Can I implement VAT or Discounts for example and do Math before importing Var to Record?


You can use NeoBook's Math action to perform calculations and store the results in a variable.

2. I am not sure how to use the DB Invoice report.. I am thinking of implementing a different approach.. Can you guide me on a much better approach in generating invoices with Invoice Number generated?


There are many different ways to generate invoice numbers. You could add an AutoInc field to you table and have the database generate a number automatically. You could keep track of the last used number yourself in a variable and increment it before each new record is created. Save the number to a file or the registry to remember it when you app closes.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Searching through Database and Displaying Results

Postby radz123 » Tue Aug 18, 2015 7:29 pm

Thank you for your help. I was able to follow through the DBPro Help file. It helps alot.

By the way, Is there a way to put say - ListBox1 and ListBox2 insert them through the Database in separate field values
Say Listbox1 goes to Product Name field (DB)
Say Listbox2 goes to Price field (DB)

I tried setting up the TWO Listboxes but whenever I pressed on EACH of them.. It adds separate rows of records
Is there a way to SELECT or rather AUTO-SELECT ALL the values contained within the TWO Listbox Objects? And Insert this values to a new record in the Database? e.g (Product Name, Price)?
radz123
 
Posts: 7
Joined: Tue Jul 21, 2015 10:17 pm

Re: Searching through Database and Displaying Results

Postby Neosoft Support » Wed Aug 19, 2015 11:01 am

You probably have to have a separate button to create a new record rather than doing it in the ListBox. So the button adds a new record (dbpAddRecord), then each ListBox is assigned to one of the record variables (ie: [MyDB.Table.Field]). The ListBoxes shouldn't need any code unless you're doing something unusual.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: Bing [Bot] and 0 guests

cron