1

(14 replies, posted in Script)

Hello Kofa, CDB, Brian, Agusec,
If you set the first combobox element = 'please choose class, then you'll probably want to be doing it for all your comboboxes and edit fields.  This can start to make your form look rather 'busy'.
A different option is to use hints which only display when the user hovers over a specific object.  Hint work on most objects - so you can set a hint for a combobox, a datetimepicker, an edit field, a button, a label etc etc.  The advantage of this is that the approach is consistent, so your user always gets the same style of help no matter what they're doing.
Hints are very easy to set up - have a look at the screenshot which sets up a hint for a combobox - it is exactly the same for all other objects.
Derek.

2

(7 replies, posted in Script)

Hi Kees, Jean, Brian,
Yes, agree with the others - do it something like in the attached (userid = Kees, Password = kees).  I've done it as a label, as per your earlier post, but it's just the same if you use a separate form or a pop-up panel etc.
If I remember correctly (which I don't too often these days - LOL!), 'application.user.xxxxxx' was introduced in 6.3, so if you're using an earlier version, I think you need to just use 'user.xxxxx'.
Stay safe,
Derek.

3

(14 replies, posted in Script)

Hello Kofa,
There are a couple of ways to do this, but the normal way is as follows:
1.
Create additional tables for each entity that you want to have a combobox for (in your example - classes, sections and nationalities).
2..
Remove the class, section and nationality fields from the 'students' table and replace them with relationships to the classes, sections and nationalities tables
3.
In Form1, replace the class, section and nationalities edit fields with comboboxes and set them up so that they are part of the search criteria (in the same way as you have already done for the other edit fields).
4.
Create a data entry screen for the class, section and nationality data - there are many different ways to do this but in the attached example, I have used a page control and added a new tab sheet (called Reference Tables).
Hope this helps,
Derek.

Hi Kofa,
Is this the sort of thing you need?  Please look at the attachment (including screenshot1.jpg).
Type anything in the 'description' search field and matching rows of data are automatically displayed in the tablegrid.
Derek.

Hi,
Basically, there are 2 ways to do this.
1.
Use a calculated field (see Webapp1 in the attachment - calculated fields are defined in the same place as your data structure but are 'virtual' fields - they only exist while the program is running).  This is the most data efficient way as the result is not saved to the database - the result is simply calculated whenever required by the program.  The only down side to this is when you add or edit a record, the result of the calculation is not seen (in Form2) until the record has been saved.  The result is, however, shown immediately in the relevant tablegrid (Form1).
2.
Define a field in your table to hold the result of the calculation.  Then add a small script to recalculate the result whenever any of the relevant fields are changed (see Webapp2 in the attachment).  This way, you always see immediately what the result of the calculation is in both Form1 and Form2 but at the expense of some data redundancy.
.
There is actually, a third way (which would be my personal preference) which is a combination of the above - use a calculated field (so there is no data redundancy) and use the same script to update the result of the calculation immediately in both forms (see Webapp3 in the attachment).
.
It's actually a lot easier just to see it working than it is to try and describe it - LOL!  Any questions, just shout.
Regards.
Derek.

6

(4 replies, posted in General)

Hi George,
The list of supported commands is available within the script editor by opening the relevant section (for example, see the attached for a list of file commands).
Derek.

7

(10 replies, posted in General)

Hi Geochrist,
Is this the sort of thing you need?
http://myvisualdatabase.com/forum/misc. … download=1
Derek.

Hi,
I believe that the 'table object' was introduced with FastReport Version 6.  MVD uses FastReport Version 4.
However, in Version 4 there is the 'DB cross-tab object' that may be suitable for what you want - please see the screenshots in the attachment.
Derek.

9

(3 replies, posted in General)

So, using my earlier example, you'd just type in 'id' instead of 'country'

10

(3 replies, posted in General)

Hi,
Perhaps try doing it like this (see screenshot in the attached example);  since a couple of versions ago, 'sort field' and 'sort order' were added as new combobox properties instead of doing it with '1=1 order by.......' (which was really just a workaround) in the 'filter' property.
Derek.

11

(4 replies, posted in Reports)

Hi Salahnecibi,
I think you are meaning the RTF formatting codes.
If so, what is probably happening is that when you are in the Report Designer, you are dragging the datafield directly into the report or selecting the RTF component and then dragging the datafield into the RTF component?   In both instances, this will result in you seeing the formatting codes rather than the actual text..
You must first place an RTF component into the report.
Then you must specify the dataset and the datafield USING THE RTF object's properties (don't drag and drop it from the list of available datafields).
Please have a look at the screenshot (screenshot1.jpg) in the attached example which shows the steps to go through.
Derek.

Hi Iacobescubogdan,
Welcome to MVD.
I had to change your original project a bit - it's not usually a good idea to try and combine data maintenance (add, edit, delete)  and data display / enquiry / filter all on the same form.  It results in a lot of extra coding to validate your data (blank and duplicate records are the main problem).  In your example, you also use comboboxes for both data input and for data filtering which can be confusing for users.
Please have a look at the attachment.  I've used 2 tablegrids on your 'grupavasile' form so you can see the employee summary and employee details at the same time (and it's easier to test (LOL!) that the filters and dates are working properly.  But it's easy enough to change the layout to suit your requirement - the basic processing is in place.
The employee summary (by selected date range) has to use an 'sqlquery' and there is also a small amount of code in the script (not strictly necessary - it just automates what you'd otherwise have to do manually.
Hope this helps,
Derek.

13

(2 replies, posted in General)

Salut Jean,
J'espère que tu et ta famille allez bien.
Thanks for your help - it's now working exactly as I want it - perfect!.
I owe you one.
Derek.

14

(2 replies, posted in General)

Hello All,
Some help please.
I can disable the popupmenu that is associated with a tablegrid successfully ( form1.tablegrid1.popupmenu := nil; ).
However, when I try to do the same thing with either a memo field or an edit field, it has no effect - the popupmenu still displays..
In the attachment, right-click in the tablegrid and there is no popup - just a message that I want to display.  But right-click in the memo field and the popup still displays first and only after that a message.  Right-click in the edit field and it is the same problem.
Does anyone know how to disable the memo field and edit field popup menus so that they do not display at all?
Thanks,
Derek.

15

(6 replies, posted in General)

Looking at the sceenshot, I'd hazard a guess at a incorrect / cartesian join between employee and department tables but as Jean and Sibprogsistem have already written, unless you upload your project or describe in detail what you're doing, I'm not sure what help you can realistically expect.
Derek.

16

(5 replies, posted in General)

Hi Abu7akm,
You need to be clear that calculated fields are not 'real' fields - they do not get stored in any tables;  they only exist while your program is running.
Calculated fields can be used to avoid data redundancy - for example, you know the price and quantity of something, you could use a calculated field to display it's value (price * quantity);  holding the value in a table is redundant.
Calculated fields can be used to display data that is variable - for example, if you know someone's birthday, you could use a calculated field to display their age;  holding their age in a table is both redundant and inaccurate (it will only be correct as at the time of saving).
Calculated fields can be used to concatenate data fields - for example, if you know someone's salutation, first name and last name, you could use a calculated field to join them together (for example, in a mail-shot);  again, holding the concatenated salution and names in a table is redundant.
Calculated fields can be used to display summary information - how many invoices per customer, the most recent invoice per customer etc etc 
Please look at the attachment that contains various examples of calculated fields.
Having said that, if you are relatively new to MVD, there is a danger that this could hinder as much as help.  It might be better if you just said what exactly it is that you need to use a calculated field for and then build up your knowledge from that point.
Derek.

Здравствуй Danisl,
Вам необходимо изменить sql отчета, чтобы включить выбранные даты, используя > = и <= (см. Вложение).
Derek.

Hi,
If I understand your question correctly, you don't need to write any sqlquery.  Filtering a combobox based on the value of another combobox is standard MVD functionality.
Try using the 'parent combobox' property (see the screenshot in the attached example).
Derek.

19

(5 replies, posted in General)

Hi Frank,
Never had that problem so not sure what it could be down to.
But a couple of related things to mention that could help when you're lining objects up on a form that you may or may not be aware of (please see the attached screen capture).
1) there is the option to switch on 'display grid' which helps to visually align objects;  the size of the grid display (concentration of the dots!) is determined by the 'grid size' option - the lower the number, the more you can fine tune an object's alignment.
2) the 'grid size' option doesn't just determine the number of 'dots' you see when the 'grid display' is switched on.  It also determines the increments that the object moves by when you drag it with the mouse and this is irrespective of whether 'display grid' is selected or not.
Perhaps if you set your 'grid size' lower, you can place your objects on the form accurately enough with the mouse alone and not have to use CTRL+arrow keys.
But at the end of the day, it's whatever works best for you.
Derek.

20

(2 replies, posted in General)

Hi,
Might not be exactly the calculation you're after (and I've not worried about specific days within a month etc) but the attached might give you an idea of how you could approach it.
That said, I'd probably use 2 tables - one table for the loan itself (start and end dates) and one (related) table for the individual repayments, in which case the calculation of payments made, payments outstanding etc would be done completely differently.
Anyway, hope this helps,
Derek.

Hi Vit007,
В приложении приведены примеры того, как брать значения из таблицы и помещать их в поля редактирования.
Может это поможет.
Derek.
.
In the attachment, there are examples of how to take values from the tablegrid and place them into edit fields.

22

(8 replies, posted in SQL queries)

Hi,
It's just a calculated field left deliberately empty but it enables you to specify a footer column calculation, ready for when the sqlquery runs.
The empty calculated field columns are then filled with data from the sqlquery and the footer calculation then works on that data.
Derek.

23

(3 replies, posted in General)

Hi Frank, Hi Brian,
Another option, using Brian's example (thanks Brian), would be to add calculated fields to show how many of each residence type the user has.  Then take the value in the relevant 'full time residence' cell and, if it's 1, then don't show 'full time' in the combobox drop-down (and vice versa).
I've shown it for all residence types but you could choose to do it just for the 'full time' type -  and if you didn't actually want to see the 'full time' column in the grid at all, you could always hide it.
Derek.

24

(8 replies, posted in SQL queries)

Hi,
I probably didn't make myself clear - you still need to use the sqlquery to get the actually data and group it by date.
Using a calculated field is just another way to specify the footer calculation (sum) and on what column you want it (see the attached screenshot), rather than having to do it by script.
Derek.

25

(8 replies, posted in SQL queries)

Hi,
To have footer calculations when using sqlquery, you need to add a small script (please see attachment) which
1.  tells the program which column you want to perform a footer calculation on
2.  tells the program what kind of footer calculation you want to perform (in this example it is fksum)
3.  tells the program to perform the calculation using the 'calculatefooter' function
4.  You also need to make sure that the 'gofooter' option in the tablegrid properties is set to true (see screenshot in the attachment).
All of the above could also be done with calculated fields and adding footer options in the 'standard' way.
I have also amended the sqlquery calculation which contained an error (my bad!) - it wasn't selecting records where the opd visit date was the same as the 'to date' parameter in the search.  This happens because the opd visit date is defined as a date/time' type so the program needs to (in effect) add a day to the 'to date' parameter.
Derek.