Hi,
In the suggested attachment, I've deleted the 'cost' table and hold your 4 different expense types in the 'document' table.
I also just show all the expenses (and then the calculated 'totalexpenses') in a panel rather than having to click a button to get the breakdown;  it's more straightforward.  It also means that you can delete the form 'frmcost' - the fewer forms you have, the quicker your application will load.
The 'totalexpenses' calculation for Form2 is in the script - it simply recalculates the 'totalexpenses' whenever the value of any of the 4 expense types changes.
Derek.

Hello Peacemaker,
I've just had a quick look at your project and I'd make the following comments.
1.  The dropdown boxes are working correctly but you have hidden form1.button1 and form1.button3 so no values have yet been entered for 'type' and 'rsotype'.
2.  Form2.button8 has been defined as 'showform'  Your 'rso' data is actually being saved but incompletely (rso. id_document is blank).  In other words, the 'rso' record doesn't know which 'document' record it is related to.  Use 'newrecord' instead of 'showform' and rso.id_document should get filled in correctly.
3.  The 'show cost breakdown' button has also been defined as 'showform' rather than 'newrecord' so, same problem as 2) above.
4.  I would use editable tablegrids on Form4 and Form5 - the way you have done it does work but makes it very easy to create both blank entries and duplicate entries.
5.  I am not sure why you are using a separate cost table if you have a fixed number of discrete fields (4) for 'food', 'supplies', 'transport' and 'expenses' - you might just as well delete the 'cost' table and hold them as discrete fields on the 'document' table which will simplify things.
6.  Whether you hold your costs in a 'cost' table or as part of the 'document' table, I would use a calculated field to get the 'totalcost' rather than store it which is data inefficient.
7.  Irrespective of where you hold your costs, they should be defined either as 'currency' or 'real', not 'text'.
8.  In your script, you are hiding frmlogin once the user has successfully logged in - this leaves the application running even when the user has logged off.
There may be other things - I've only had a few minutes to look.
Regards,
Derek.
..
..
Sorry Jean - only just seen your earlier reply.

1,653

(5 replies, posted in Script)

Hi Hedan,
A couple of ways you could do it but I think I would use a calculated field (see attached example).
Regards,
Derek.

1,654

(4 replies, posted in General)

Hello Kristof,
I don't believe you can directly display the table ID of a record on a form, so I'd simply use a calculated field instead.
But if you want to perform an sqlexecute statement based on the ID of the record, the ID doesn't actually need to be displayed anywhere - you should be able to retrieve it from the calling form's tablegrid ID  - 
sqlexecute('select fieldname from tablename where id =' +form1.tablegrid1.sqlvalue);
Derek.

Привет, Vyvern,
Один из способов сделать «групповые» изменения - поместить все соответствующие компоненты в панель (или групповой блок); свойства родительского компонента имеют приоритет.
Затем вам нужно всего лишь сделать 1 изменение состояния включения / выключения (или видимого / невидимого).
В этом примере я использую 2 панели (1 панель имеет свойство bevelwidth = 0, чтобы вы его не видели).
Это также помогает при разработке формы, потому что вы можете перемещать группы компонентов очень быстро.
Но я ценю, что иногда ваш макет формы может не подходить для этого варианта.
С уважением
Derek.
(с гугл переводчиком)

1,656

(59 replies, posted in Database applications)

Hi Darek,
I'd use a calculated field to get the count of nominations in each category.
In your 'categories' table, add a calculated field and attach the following code:
(select count(id) from nominations where nominations.id_categories = categories.id)   
Then add this calculated field to tablegrid1 in Formcat.
Derek.

1,657

(59 replies, posted in Database applications)

Hi Darek, Hi Jean,
If you don't want to use TTimer, attached is a different way of doing a splash screen.
Also attached is how to change the BACKGROUND color of the tablegrid column headings.  But note for this to work, you need to change the tablegrid header style to 'hsauto' (if you use the 'hsoffice' header style options, it has no effect) - see screenshot1 in the attachment.
Also note that changing the TEXT color of the tablegrid column headings is not supported. 
I've done these suggestions in a separate program because I didn't want to mess up anything in your Oscars project, but my bits of script can be copied and pasted into yours if needed.
Derek.

Hi DBK,
Perhaps the relationship is incorrectly specified.
Can you attach your project and I'll have a look.
Derek.

1,659

(1 replies, posted in Russian)

Привет,
Формат формы ввода данных не влияет на способ ее отображения в таблице.
Я бы использовал вычисленное поле, чтобы изменить отображение на HH: ММ (см. Приложение и screenshot).
С Уважением,
Derek.
(с гугл переводчиком)

1,660

(3 replies, posted in General)

Hi DBK,
The calculated field in your example is, at its core, like this:
(case
when id_type = 1 then name
when id_type = 2 then company     
end)   
The other elements are simply to add the text literals '(C) ' and '(P) ' and the || is the way in which you join two or more fields (or a text literal and a field etc etc) together when using calculated fields.
I guess it's like any syntax rules ........ you simply get used to them after a while!
Derek.

1,661

(3 replies, posted in General)

Hi DBK,
I'd try it using a calculated field (see attached).
I've added a (C) or (P) to indicate whether the name in the combobox is Company or Private - this also means that you can easily sort the drop-down list by client type, if required.
Is there a need to have 2 separate fields for 'private name' and 'company name' since you already know from the 'type' which it is? - just a thought.
Hope this helps,
Derek.

1,662

(6 replies, posted in General)

Hi DBK,
If you want to clear all the fields, you can use 'componentcount' and loop through all the fields on your form, clearing each of them (use button4 on form1 in the attached example).
However, rather than use 'showmodal', you could just use a normal button with a 'new record' action associated with it - but hide the button.  Then when you click on your 'new record' image, the hidden button associated with the image is clicked by your script (see attached example);
procedure Form1_Image1_OnClick (Sender: TObject);
begin
  form1.button1.click;
end;
This then avoids all the issues with clearing fields, using modal forms etc etc.
Hope this helps,
Derek.

1,663

(6 replies, posted in General)

Hello Agusecc,
Please find attached your project with a pie chart included.
Regards,
Derek.

1,664

(12 replies, posted in General)

Hi Adam,
Drag and drop is actually supported (see screen capture), although note that it doesn't drag child nodes with it (which may or may not be what you want).
But the real problem is saving the node in its new place in the structure.   Saving re-sorted nodes alphabetically within the structure isn't a problem but you mentioned in an earlier post that you wanted to do it 'freehand' and that, as far as I understand it, is a different matter altogether.  I can't think of a straightforward way of doing it - I wondered if it might have been possible using 'autoincrement' but I believe it's only supported with tablegrids and not treeviews.
Derek.

1,665

(29 replies, posted in General)

Ciao Fabio,
I hope I have understood your question correctly.
I have changed the report so that the total cost, the total commission and the total refund is shown.  The layout is probably not what you want but that can always be changed.  But you can see the calculation and that is the main thing.
I have also commented out some of your script - specifically, the places where you are hiding forms.  I'm not sure why you are doing it that way and the main problem is that when you quit your program, it leaves processes running in the background.
Regards,
Derek.

Hi DBK,
It's the button that is causing a problem;  there are a couple of things to mention.
1.  Your 'add' button is trying to save the tablegrid (see screenshot.jpg highlighted in red) rather than fields.
2.  If you use editable tablegrids you don't need 'add', 'edit' or 'save' buttons at all.
3.  (this is the actual error).  If a button has it's 'default' property set (see screenshot.jpg highlighted in blue) then whenever 'enter' is pressed, the button is clicked (because it's the default!).  So what is happening is when you press 'enter' to save the editable tablegrid data, it is clicking the 'add' button instead - and then giving you the error.
To fix it, either set the 'default' property for the button to 'false' or remove the button completely - it's not currently doing anything.
Hope this makes sense.
Derek.

1,667

(3 replies, posted in General)

Hello Manixs,
I wrote this to chat between users.  It doesn't store read messages, check whether users are logged on or anything like that - the requirement was to keep it very simple (but if you message a user who isn't logged on, the message is saved until they log in).
To test it in a single user environment, log on twice as two different users (all passwords are the same as the usernames (case sensitive)), type a message, choose the user to send it to and press 'enter'.  Then switch to the other user and you should receive the message.
Obviously, if you're able to test it in a mult-user environment, it's much simpler.
It's a very old program so it probably needs testing to check it still works okay and I'm sure you'll want to add more functionality to it but perhaps it gives you some ideas.
Derek.

Hi DBK,
If you can attach your project, I'll have a look and see if I can spot anything.
Derek.

1,669

(59 replies, posted in Database applications)

Hi Darek,
Please see attached with a few posters saved - https://app.box.com/s/l9s19i6grjdw91as50isrd76jbe1n2be
When you have a lot of images, it is better to use the 'linkfile' option to reduce the size of the program  (see attached screenshot).  Also, the 'copy to' option is very useful - if you find your posters from many different locations, 'copy to' takes a copy and stores them all in one place so it is easier to manage.
I've also added a column to the films tablegrid so you can see which films now have posters.
Derek.

1,670

(12 replies, posted in General)

Hi Adam,
Are you trying to move things in the Tree so that they are sorted alphabetically or are you wanting to move child nodes to a different parent node?
Derek.

1,671

(4 replies, posted in General)

Hi Manix,
Can you not just insert leading and trailing spaces before or after your button caption?  (see attached)
Derek.

1,672

(59 replies, posted in Database applications)

Hi Darek,
I had a bit of time so I added a couple of things to your project that may be useful.
1.  Now you can enter a nominee in the 'Nominee' search box (for example  'John Wayne' and select a film from the Nominations tablegrid (for example 'True Grit') and this will select films called 'True Grit' into the Films tablegrid.  Then click on 'True Grit' in the Films tablegrid to see ALL of the nominations for that film in the Nominations tablegrid .......  So now it is easier to go back and forth between the two tablegrids.
2.  Click on the 'Oscar' image to link to the academyawards website.
3.  Click on the 'Tomato' image to link to www.rottentomatoes.com website for film reviews (it finds most of them).
Hope this helps to give you ideas for your project and some of the things that MVD is able to do.
Derek.

1,673

(59 replies, posted in Database applications)

Hi Darek,
Attached is your project with the oscarsfull.csv data loaded (loaded the same way as described in my earlier post).
Regards,
Derek.

1,674

(5 replies, posted in General)

Thanks Dmitry.

1,675

(5 replies, posted in General)

Hi DBK,
There's a couple of things that either don't work or haven't been implemented yet in the tablegrid properties.  From memory, the only option that seems to work with regard to selected text is 'boldtextselection' in the 'appearance options' properties.
So as far as I know, if you want to show the selected row in a different colour, you'd have to do it by script (please note that the way I do it doesn't actually replace the standard highlighted colour, it simply paints over it).
Regards,
Derek.