2,351

(10 replies, posted in General)

I imagine we all do it in different ways.
For what it's worth, I try to provide the user with a general help file but back it up with field specific help;  when it's too long for text-hints or where the hints disappear before you've had time to read it all, I use 'showmessage' and usually initiate it on a button click (but it can be fired from image-hover, image-click etc etc). 
It's not sophisticated but it's quick and simple (like  most of my stuff - LOL!).
Have a look at the attached and see if it's of any interest.
Derek.

2,352

(5 replies, posted in General)

Hi Adam, Hi Mathias (long time no see - hope you're doing okay!),
Yes, I'd do it just the same way - drop an image on the form then place your components on top of it.
Sometimes the image is too dominant, so I just watermark it so it's more in the background
See attached.
Derek.

2,353

(29 replies, posted in General)

Hi Again Adam,
I think I understand the scenario you're trying to trap so I've added a simple test for an invoiceheader record with no associated invoiceitems records and, where this is the case, automatically delete the invoiceheader record to get everything straight again.
Remember that the invoiceheader record is actually saved when you click 'add an item' and not when you click 'save header'.  I can see why it is confusing but it is logical - it is done this way otherwise the invoiceitem record would have no 'parent' at the point when it gets saved.
Derek.

2,354

(29 replies, posted in General)

Hi Adam,
So can't you simply add a 'pre-delete' button using the same logic as the 'pre-save' button (or am I missing something?).  Please see attached.
Of greater concern is that the form currently lets you save an invoice with no customer and no invoice number.
A more general point -  with most invoicing systems I've worked on, it is a valid scenario to have invoice headers with no invoice lines;  just a thought.
Derek.

2,355

(29 replies, posted in General)

Hi Adam,
Not being technically minded, I probably approach the problem from a different angle to other users. 
I find there are occasions when I want to 'check' what has been entered (or not entered) but it's too late once 'save' has been clicked.  So, I create a 'pre-save' button which just runs any required validation in a script.  If okay, the script then clicks on the 'real save' button.
There are a couple of extra things;
1.  I always set the 'real save' button enabled property to false initially;  this prevents the record being saved if the user accidently presses 'ENTER / RETURN' instead of 'TAB'.
2. I also set the 'real save' button visible and tab-stop properties to false.  Therefore, the button you actually see and click is the 'pre-save' button, not the 'real save' button.
As always, it is much easier just to see it working, so I've added it to your script.
Hope this helps,
Derek.

2,356

(18 replies, posted in General)

Hi,
The first line errors because you are using SQL to retrieve a calculated field (customers.lookup_value);  calculated fields don't actual 'exist' in terms of being stored in a table, they are simply used as temporary containers to hold data whilst the program is running.   
The field you actually need is customers.id_lookups. 
So, you should replace:
Form1.cbCust_Title.Text := SQLExecute('SELECT customers.lookup_value FROM Customers WHERE id='+Form1.TGrid_Form1Search_Customers.sqlValue);
WITH:
Form1.cbCust_Title.Text := SQLExecute('SELECT customers.id_lookups FROM Customers WHERE id='+Form1.TGrid_Form1Search_Customers.sqlValue);
But without seeing the script 'in situ' with the application, I can't be 100% sure.
Derek.

2,357

(18 replies, posted in General)

Hi,
You have called the fields in the 'lookups' table 'key' and 'value'. 
However, in your calculated fields you reference it as 'lookups_value';  it should be 'value'. 
In the combobox  'filter' object property, you reference it as lookups_key;  it should be 'key'. 
Two of your calculated fields have a leading space in their name (not a problem now but maybe later??). 
See the screen capture in the attachment along with the project with the calculated fields and the object properties for the comboboxes changed as per above.
Derek.

2,358

(18 replies, posted in General)

Hi Adam,
Glad it helped.  I'd agree about your 'one to many' between people and classes - much better (and easier as it's just vanilla MVD) to display them in a separate tablegrid
If you're having a problem with a new look up and all the others work okay, i'd have to suspect something in the way you've added the new ones or something else that has been added/changed at the same time.
Can you attach a copy and I might be able to spot something.
Derek.

2,359

(18 replies, posted in General)

Hi Adam,
Attached is your project with an example of how you can do it by script (which is, to my knowledge, the only way);  it allows the user to scroll through the grid using both mouse and keyboard (only having one or the other would be confusing for users).
It is not possible with your current structure to display details from the 'classes' table in the same way because you don't have a relationship (join) between the 'people' and the 'classes' tables.
Regards,
Derek.

Hi,
Attached are 2 screenshots to show you what you need to change.  The changes will work in 1.49.
Alternatively, you could download the latest trial version of MVD (2.7) open my previous attachment and see how to copy the changes back to 1.49.
Derek.

Hello Kkalgidim,
I hope I have understood your problem.  I have made 2 changes.
1.  In your tablegrid, change siparis.id_kim to kim.isim
2.  Use a calculated field (siparis.cfisim) to get the description of the delivery person and then in the tablegrid, change siparis.id_kim1 to siparis.cfisim.
Maybe this has fixed it for you?
Derek.

2,362

(29 replies, posted in General)

Hi Adam,
Just had a quick look (rushed for time) and a few issues stand out.  However, the 2 that immediately caught my eye are:
1.  the invoiceitem table needs to be joined to the taxrates table (that should fix the error you're getting when saving the invoice item)
2.  the invoiceitem table needs to be joined to the invoiceheader table (the invoiceline currently doesn't know which invoiceheader it belongs to).
Hope that moves you on a bit.
Derek.

2,363

(29 replies, posted in General)

Hi Adam,

Ask 100 people and you'll get 100 different answers!  And while the theory of relational database design MIGHT be a good place to start, there are also practical reasons why you might end up doing things differently.

To give a brief response solely to your diagram, I would make the following comments (just my view, not saying it's right or wrong!)
1. I would remove 'invoice' table and have 'invoice_header' table (with fields for invoice number and invoice date) and 'invoice_line' table (with fields for qty).  Curently, you are repeating the invoice number and invoice date - a 10 line invoice will have the invoice number and the date repeating 10 times
2. Storing Net price is redundant -it is simply the result of the calculation of invoice_line.qty*products.unit_price
3. Obviously, you'll need your joins (customer to invoice_header, invoice_header to invoice_line, invoice_line to products)

But now the fun starts.  Consider these scenarios:
1.  The price of the product changes - you probably don't want the new price reflected in the invoice.  So you might deliberately choose to copy the unit_price from the 'products' table and then hold it on the invoice_line table (introducing data redundancy).
2.  The same goes for tax_rate - that could change as well.
The theorists would probably have you create new tables for product price changes and tax rate changes with 'from' and 'to dates and relate it back to the invoice date.  The pragmatists would probably suggest you initially look-up the 'products' table to get the unit_price and the tax_rate, but then actually hold unit_price and tax_rate on the 'invoice_line' table.
3.  Do you need to know the value of the invoice?  The theorists might have you perform invoice_line.qty * products.unit_price and then sum up the result for all of the lines in the invoice.  The pragmatists might say that it's something you frequently need to know and it takes too long to perform the calculation every time.  So, for the sake of a quick response time for the user, it's okay to deliberately introduce data redundancy and have a field called invoice_header.invoicetotal where the calculation is performed once and then stored. 

These are just a couple of simple issues you need to consider when designing your application. 
Even more important, you might have to consider whether MVD does it easily (with no script) one way, but doing it another way might involve significant complexity and a lot of script writing.   I know the software SHOULDN'T determine the approach you take, but it's a fact of life!

Not sure if any of that helps and, as I said, just my view!

Derek.

2,364

(13 replies, posted in General)

Hi Adam, Mathias, JB,

About duplicate checking - Mathias, you said that you have your own way of checking that includes case sensitivity.  Could you show me how you do that?  Like you, I use my own duplicate checking routine - basically, I use a 'pre-save' button (that also shows duplicates for entries entered in different case (UPPER, lower and MiXed) but I would be interested to see how you do it.
I've attached the way I approach it in case it's of any use to anyone.
Regards,
Derek.

2,365

(13 replies, posted in General)

Bonsoir JB, Adam, tout le monde!
The reason why I created the 'derekclearform' procedure is to stop a slight error happening.  For example:
1.  You click 'add a new record' but maybe get interrupted, so you press 'cancel' instead of 'save'. 
2.  The next time you 'click add a new record', the 2 'not null' edit fields (in this case, 'name' and 'surname') have not been cleared out. 
Admittedly, 'derekclearform' could have just specified the 2 'not null' fields but for completeness, I added the others as well.
Hope that makes sense.
Derek.

2,366

(13 replies, posted in General)

Hi Adam, Jean, Math, (League of Nations - LOL!),

I had a quick look at your issue and (as always) try to take the easy / lazy) route!!  Rather than enable / disable various buttons, can you not make the fields on the form invisible and then reveal them when add / edit a record.  As all your fields are in a panel, you can simple make the panel invisible rather than having to do it for each field (panel properties take precedence over objects contained within the panel so can be a great time-saver - and look quite neat too).
Anyway, for what it's worth, I've attached a version of your project doing it this way so have a look and maybe it will be useful.
Derek.

2,367

(3 replies, posted in General)

Hi Adam,

What you are looking for is "in grid editing" which is, I believe, something that was introduced in Version 2.0 (and one of the main reasons I upgraded).   New additional grid object properties of 'go input' and 'go inplace editevents' appeared (and many more) but I am not sure how they are meant to work (if, indeed, they do).  It is a pity that tablegrid improvements seem to have been down-graded in recent releases, considering how 'core' to MVD the tablegrid is and how many issues in this forum relate to tablegrid problems.

Ticking 'go input' gives you a row above the grid which can be used to enter new data but doesn't appear to work if you what to edit entries (you still need to use the usual edit text box components and so you've gained nothing).  Further, using 'go input' doesn't give you any validation that you might have set up for your edit text boxes (although I suppose you could script it, but that's not the point).

So, short answer to your question,I believe, is 'no'. 

Derek.

2,368

(11 replies, posted in General)

Hi Adam,
The 'visible' object property of each of the highlighted images (add, edit, delete, search etc) needs to be set to 'false' in your form design.
Derek.

2,369

(11 replies, posted in General)

Hi Adam, Jean,
Attached is the way I would do it - there are other ways too but I always go for the easy life - LOL!
Have a look at the script - I think it's pretty self-explanatory but give us a shout if something's not clear.
Derek.

2,370

(11 replies, posted in General)

Hello Adam, Hello JB,

I've used a couple of different ways in the past to get these sort of effects.  Have a look at the attached project and see if any of them are of use to you.
Basically, the 3 methods are:
1.  change the button caption when the mouse hovers (it's a pity that MVD allows you to change the caption but not the colour)
2.  use a panel as a 'false button' so when the mouse hovers, you can change colour and/or caption
3.  use your own image, overlaid over each other so when the mouse hovers or moves away, the 2 images are toggled.

Hope this helps,
Derek.

2,371

(3 replies, posted in General)

Great.  Glad it helped.
Derek.

2,372

(3 replies, posted in General)

Hello Heriberto,
Attached is a small demonstration project I wrote a while ago.
It uses just one lookup table for everything and does not require a script (just a couple of extra calculated fields to retrieve lookup-descriptions) so keeps it nice and straightforward.
Maybe it will give you some ideas.
Derek.

2,373

(5 replies, posted in General)

Hi Adam,
See attached screen shot.
Derek.

2,374

(5 replies, posted in General)

Hello Adam, Thierry,
You can also add to Thierry's suggestion by using the 'incremental search' object property which will start filtering records in the tablegrid as soon as you start typing rather than enter part of the field (%s%) and then clicking 'search'.
Look at the attachment and notice how the 'first name' and 'last name' fields now behave when searching.  Some people prefer it one way, some the other - MVD gives you the choice.
Derek.

2,375

(10 replies, posted in General)

Hi Adam,
Following on from your previous posts about putting the contents of a text file into a memo field and now your latest post about wanting to give the user more detailed instruction when filling in a form, you can always link a help text file to specific fields - so the effect is leading them, step by step, through the form.
Attached is a way I've done it in a couple of applications (but there are many different ways of achieving similar effects).
Also, and apologies if you know this already, you can also add 'hints' to any object;  if your 'help message' is brief, this is the quickest and easiest way to add instructions (in the attached example, if you hover the mouse over any of the input fields, you'll see how it works).
Hope this helps,
Derek.