Page 1 of 1

Which method to use, stumped.

PostPosted: Sun Nov 20, 2016 12:28 pm
by glenwf
Played all day with conditional statements to make something work. Maybe that isn’t the way to do it. Any ideas on how to accomplish this would be great.

This will allow me to quickly in the store to enter the Width & Length and Cost of board and ask what the calculated cost per part that can be cut from any size of lumber. Then look at list view and determine the best buy on that day.

Field 1 - asks input for value for “Width”
Field 2 - asks input for value for “Length”
Field 3 - # parts taken from table
Field 4 - asks input for $ cost of board today
Field 5 - calculated cost per part ( Field 4 divided by Field 3) = $/part

I would like, knowing the data below, or having the data below in fields or a separate table (difficult for me since I haven’t successfully done linked files yet) or using conditional statements which I failed to do…

The next fields not listed will do the work which I don’t know how to approach.

I want the following:———

A: given input of fields 1 & 2 & 4, to fill in Fields 3 & 5 for a record.

—— Data is 15 possible pine board sizes ——————
Width- Lenth- parts
4 6 3
4 8 5
4 10 6
6 6 3
6 8 5
6 10 6
8 6 6
8 8 10
8 10 12
10 6 9
10 8 15
10 10 18
12 6 9
12 8 15
12 10 18

Any good ideas and or examples you can point me to???
Thanks.

Re: Which method to use, stumped.

PostPosted: Sun Nov 20, 2016 2:22 pm
by Brian_Houghton
You might consider a set of DB Popups for the first three fields instead of a conditional. Using DB Popups, you could have a separate database serve as the lookup table and contain the full set of data points (length, width and parts). Then when you open the first DB Popup, you will see this list and upon selection all three values will be added to the original database. That parts value could then be converted to an integer through the use of a calculated field. These values could then be used in your original calculation.

If you need help with DB Popups, let us know.

Re: Which method to use, stumped.

PostPosted: Sun Nov 20, 2016 4:28 pm
by glenwf
That sounds doable and I've used the popup to bring in a board's numbers as text field like
Field A = 4 8 3
Now if I wanted to that that field of 3 text numbers, how would I parce it into 3 numbers usable for calculations?
Seeing how it is not just a text that needs to be multiplied by 0 to make it a number. First it has to be separated into separate things first.

I can go forward without this step by copying the numbers into integer fields, but it would be the most logical way to do it and a useful thing to be able to do.

Thanks Brian.

Re: Which method to use, stumped.

PostPosted: Mon Nov 21, 2016 1:36 pm
by ddhsoftwareadmin
Glen,

I think Brian was getting at using a DB Popup and the groups feature. So the other database table would have three fields length, width, # parts, and would contain the entries for each combination. Then the main table would have three DB Popups all with the same group number (eg, Group value of 1 for all three). Now when you select the drop down for the db popup you can pick a record and all three will be filled out automatically.

Hope that does the trick!

Re: Which method to use, stumped.

PostPosted: Mon Nov 21, 2016 7:03 pm
by glenwf
Thanks. Fairly simple once I understood it.

That is a very powerful technique and I wish it was spelled out in a better way in the manual or a good example to download. Took me at over an hour playing with it to get it.

I wish there were very simple examples of many of the techniques. Often the examples are in a database that has so much going on that it is difficult to figure out the basic idea from the clutter.

Nevertheless, the forum is a god send and the system works.
Thanks.