Hi,
In one of the user guides, there are some references to 'treeview' but it's along the lines of 'this is what it is' rather than how to create a project using it..  I've always found it better to use this Forum's search function, look at the various posts and download projects that are of interest and use them as a guide (but I guess we all 'learn' differently).
Wit regard to using separate forms, 'standard' MVD takes the approach of one form to list the data (which can also be used for 'searches') and a second form for data maintenance.  However, it is possible to use the same form for both functions if you write a small script.
On a more general note, I should point out that MVD is no longer under active development and support for the software is solely via this Forum.  But if you submit detailed questions that are accompanied, if possible, by a project that illustrates the problem, you will almost always get a speedy response;  questions along the lines of the  "....I can't see my data.  What's wrong?' variety tend to, understandably, not get much of a response - big_smile
Regards,
Derek.

Hi,
The problem is that 'Persona' does things (and appears very good) in a way that obviously play to its strengths and so MVD (and any other piece of software) will almost inevitably not compare as favourably. 
It also means that you run the risk of ignoring the strengths of MVD by only trying to mirror the way that 'Persona' works and not considering different approaches where MVD might be more suited.
So having said that, in principle, much of what you are asking about can be done in MVD using 'treeviews'.
However, my personal opinion is that 'treeview' functionality has some limitations (you can't easily drag and drop nodes, you can't by default re-sort nodes etc/  It can be done but just not 'out of the box' and you would need to write script.
My advice would be to mock up a small scale project in MVD using 'treeviews' and see exactly where you think it might come up short.  Then post back to the Forum (attaching your project) and contributors might be able to suggest not only how to overcome any 'treeview' specific problems you may have encountered but also suggest wholly different approaches (linked tablegrids comes immediately to mind) that might be more suitable to MVD.
Regards,
Derek.

78

(4 replies, posted in General)

Salut Jean,
Attached is an old project that I made a couple of changes to and wondered if it might give you some ideas.
Basically,
1.  you tick whichever records you want to purge using the tablegrid check-box.
2.  tick the 'filter' check-box (as a way to confirm you are happy with your selections)
3a.  if you are not happy, just untick the 'filter' check-box and start again.
3b.  if you are happy, click the 'purge' button - this copies the selected records to a spreadsheet and then deletes them from the table.
I appreciate you wanted something that wrote to a text file but perhaps you can just modify this (or maybe writing to a spreadsheet is okay).
Another way might be to simply 'logically delete' checked records with a 'flag' (which always gives you the luxury of retrieving something that you might have deleted in error).  This would probably be my preferred option but obviously I don't know what your exact requirements are in this instance.
Anyway, hope it helps a bit.
Regards,
Derek.

79

(12 replies, posted in Script)

Hi Kneeme,
It's more usual to use datetimepicker fields to add up times and then display the result in days, hour, minutes (and seconds, if required).
However, if you must use edit fields, I would use discrete edit fields for hours, minutes and seconds as per the attached example.
Obviously you could use just one edit field to hold hours, minutes and seconds but this makes things more complicated when you come to substring the edit field into its hours, minutes and seconds components.  Specifically
- how do you want the user to input the values - free-hand or with edit masks?
- do you force 2 digits for minutes and seconds?
- what is the maximum digits that the hours can go up to?
etc etc
Derek.

Hi Roberto,
Another option might be to use the 'scaleby' function rather than altering the font size (although I do appreciate that there are a couple of issues with 'scaleby' - specifically with scaling tablegrids).
Maybe this also helps.
Regards,
Derek.

Hi Roberto,
If you want to increase / decrease the font size for all the edit, combobox and memo objects on a form, you could also do it something like this (see attached) which should save a bit of typing!
The attached example  uses ALT + A and ALT +D to increase / decrease the font
I sometimes find it useful to change font size, change object colour etc on forms that have a lot of input fields to make it easier for the user to see where they are (but obviously that is more interactive (ie when you actually enter / leave the input fields))
Regards,
Derek.

82

(15 replies, posted in SQL queries)

Hi,
Never had any problems creating databases nor ever had any issues with the various search options available in MVD..
Perhaps it would be better to mock-up an example that illustrates the points in your message, zip the application folder and attach it.  Then people can address any specific concern you have..
Derek.

83

(6 replies, posted in Script)

Salut Jean,
Ça va ?
As usual, it's good that MVD gives us options:
1 - 'namecase' capitalises every single word in the whole edit field.
2 - 'uppercase(form1.edit1.tex[1]) capitalises just the first word in the whole edit field.
It's all depends on what Vickus needs his application to do.
Bonne année,
Derek.

84

(6 replies, posted in Script)

..... and here's a version that works interactively (ie as you type).
Regards,
Derek.

85

(6 replies, posted in Script)

Hi,
The easiest way is probably to use the 'namecase' command (see attached).
The only slight disadvantage to this is that it doesn't work interactively (in other words, as you type).
Derek.

86

(12 replies, posted in Script)

Hi,
It's not clear from your post if you need to consider whether the time range spans more than 1 day (in which case you need to use both date and time rather than just time),  whether the 'to' date/time is always greater than the 'from' date/time etc.
However, as a basic suggestion, have a look at the attachment.
Derek.

87

(12 replies, posted in Script)

Hi,
Is there a particular reason why you are using a textbox instead of a datetimepicker to hold the time?
Derek.

88

(7 replies, posted in General)

Salut Jean - Joyeux Noël à toi et ta famille
Derek

89

(7 replies, posted in General)

Thank you Destiny and season's greetings to you too.
I wish you much success with your various MVD projects in 2024.
Regards,
Derek.

Hi,
Glad it helped.
To summarise, the problem in this case is that you can't access any of the 'frmdbcorexxxxx' forms directly and so can't attach a procedure in the usual way. 
So instead, you use the  'onactivate' command which you associate with a specific form being opened (in this example 'frmdbcoreuserform')  and then call your own procedure ('@filterrole' in this example) that then contains the code to filter your combobox.
Just a word of caution - MVD script language uses only a sub-set of Delphi commands which means you can sometimes find something in a manual which works okay in Delphi but which hasn't been included in MVD (which can be pretty frustrating). 
But there is almost always an alternative solution in MVD if you try and approach things from a different angle.
Regards,
Derek..

Hi,
Perhaps try it something like this (see attached).
In the example, I've added a new field ('roletohide') to the _user table to hold the role that needs to be hidden rather than hard coding it in the script.
It's a bit 'basic' (I'm busy with grandchildren and Christmas for my sins  big_smile and haven't much free time at the moment) but hopefully it gives you some ideas.
The passwords for all users is 'password' apart from Admin which is 'admin'.
Regards,
Derek.

Hi,
The name of the grid is 'frmdbcoreusers.gridusers'
However, I can't find any reference to the name of the 'role' combobox on 'frmdbcoreuserform'.  I wrote a small program a while back to identify all the elements on the 'frmdbcore' suite of forms and the one element that it never found was the 'role' combobox which is puzzling.
Derek.

Hi FMR,
It's not strictly the correct way to do it ( big_smile ) but if you just want something that is quick and easy then have a look at the attachment.
Just add an empty field to your lead table and add the user name immediately prior to running your report.  Then when you close the report, remove the user name.
Valid sigin-in details are admin / admin, FMR / password, Derek / password;
Derek.

Hi Step-In,
Probably a few ways to do it.
Attached is one suggestion using a calculated field;  I've used a second tablegrid to load the consolidated (one line per driver) data before running the report rather than hijack tablegrid1 (I didn't want to mess up your layouts etc).
Select a driver using the existing combobox (combobox2) or leave the combobox blank to see all drivers.
You'll probably want to alter the layout of the concatenated field and also the report so I didn't spend any time on them - it's more just to give an idea how you could approach it.
Regards,
Derek.

95

(3 replies, posted in General)

Hi,

if form1.tablegrid1.cell[0,vi].asboolean = true  (asboolean) and also the form1.tablegrid1.cell[1,vi].asstring (asstring).

Basically, when you query the contents of an individual cell in a tablegrid, you need to specify 3 things
1.  which column the cell is located in (in your example, this is column 0)
2.  which row the cell is located in (in your example, this is the variable 'vi').
3.  what data type the cell contents contains (boolean, integer, datetime etc etc).  All cells are presented as strings in the tablegrid so, because a checkbox is a 'boolean' field, you need to specify '.asboolean' in your script if you want to perform some action on it.
Have a look at the amended example;  tick a couple of the checkboxes in the tablegrid and then click the 'all the checked' button and you can see the different data types being displayed in the 'message box' as you move through the tablegrid.
There are (as always with MVD) other ways of copying cells from the tablegrid to an edit or memo field that don't involve using the 'checkbox' - it all depends on what you are doing and how you want your application to flow.
I hope this makes things clearer.
Derek.

96

(3 replies, posted in General)

Hi,
Try it like this (see attached). 
I'm guessing that there are probably two ways you might want to see the selected rows in the memo fields (one per line or comma delimited) so both options are in the script.
Regards,
Derek.

97

(2 replies, posted in General)

Hi,
Have a look at the attached example which loads data from an external .csv, shows what rows have been matched and which have not been found and then updates those rows that match.
Maybe this can give you some ideas.
Derek.

98

(10 replies, posted in General)

Hi,
I thought that the example I sent earlier already did this.
When you have loaded your .csv file, you can click on the 'view import' button and any parts that do not exist are highlighted with a 'not found' warning.
You can simply place a button on the 'frmviewimport' form to create a new record if required.
Derek.

99

(10 replies, posted in General)

Hi,
I didn't realise that the part number could appear multiple times in your input file.
But it's a easy fix - just change the script to 'select sum(adjustment)' from .... etc etc.
Please see the amended attachment.
Derek.

100

(10 replies, posted in General)

Hi,
Perhaps you could try it something like this (see attached).
On Form1, you can
1.  manually adjust quantities by selecting a part number from the combobox, typing in an adjustment amount and the qty is updated.
2.  update adjustments in batch by uploading a CSV file.  Specifically,
2.1  click on the 'import' button to load the CSV into the 'csvimport' table.
2.2  click on the 'view import' button to review what is going to be updated - it will also show any data mismatches.
2.3  click on the '⇈' button to update the quantities in the 'tameio' table.
Maybe this gives you some ideas.
If anything is not clear, just shout.
Regards,
Derek.