If I understand you correctly, I think you now want to add/change/delete records using only form1?
If so, look at the attachment (there are other ways).
You still do not need a script to get the parent combobox functionality to work - that is fixed simply by adding a 'show record' button, as I explained earlier.
However, I have added a small script to hide the 'save' button, unless you are in 'new record' or 'show record' mode.  I do this to stop duplicate rows being accidently created - something which can easily happen when you try to do everything on just one form.  But it is just a safeguard;  strictly speaking, you do not need this script either.
Maybe this is what you want now.
Derek.

Hello v_pozidis,
In that case, I suggest you don't use a script at all;  just add a button with 'show record' functionality, double-click the row in your tablegrid and the information (including the correct parent combobox functionality) will be displayed (see attached).
Derek.

Hello v_pozidis.
Please find attached your project with changes.
1.  There is a new line in the script.
2.  You only need to set the parent combobox property on frmcreateexample.combobox2;  you do not set it on form1.combobox2.
Hope this helps.
Derek.

2,329

(13 replies, posted in General)

Hello Knobby, EHW,
Just to try and help clarify things. 
The script that has been written is SOLELY to load data from a .csv file.  It has NOTHING to do with creating any relationship between tables.  That is done when you define your data tables.  All you need to do is to indicate you want a relationship between two tables and MVD does it for you automatically using internally generated IDs;  it is a far simpler, easier and more rigorous approach than many of the other relational database products.
The script that uploads the .csv data does not add the account number to the calls records.  The script matches the account number from the .csv file to the account number on the CLIENTS table to obtain the relevant record id (the primary key) and then uses that record id as the foreign key on the CALLS table - that is how the relationship between the two tables is maintained.  The screen capture (calls.jpg) in the attachment shows the raw data as it is held in the two tables and may help you see how it all hangs together.
If you look at the attachment, this is pretty much how your application would be if you were entering the calls manually and as you can see, everything is done without scripts.
Hope this helps,
Derek.

Hello v_pozidis,
I have added the line to your script to show how this can be done.
I have also changed your script a bit - you don't actually need to use a variable ('s'), you can just select the value directly into the field (edit1, edit2, combobox1 etc).
I hope this helps,
Derek.

2,331

(13 replies, posted in General)

Morning EHwagner, Mathias, Knobby,
Thanks for the example - very nice. 
And easy to alter to suit other applications that require data to be loaded from .csv. 
A definite "keeper".
Regards,
Derek.

2,332

(2 replies, posted in General)

Hello John,
I had a bit of time to spare so was looking at your Commissioning Care project (I'm getting to the age where I might be one of your 'clients' so I have a vested interest - LOL!).
There were a couple of things that didn't look right but nothing that wasn't easy to change.  There are also some decisions such as storing invoice values in your invoices table as opposed to calculating them every time the program is run - but that's probably a bit further down the line for you.
Anyway, I played around with it a bit and also changed a couple of the forms (I replaced your pagecontrols and tabsheets with some linked grids so you can see patients and their related care packages and invoices all on one screen) just to give you an idea of the sort of things that you can do with MVD;  it's always easier to follow when you see it done with your own application.
The script is a bit 'random' as I was just putting odd things in as they occurred to me, but it's all straightforward stuff.
Anyway, maybe it will give you some ideas and help to move your project forward.
Derek.

2,333

(8 replies, posted in General)

Hello George,
Is this the sort of thing you're after?  (see attachment).
There isn't really any book for MVD although general references for Delphi, Pascal etc might help. 
The videos that Dmitry took are a good place to learn the very basics and the help file is okay too. 
But for me, the best source for learning is the forum itself, particularly downloading various attachments and just seeing how other users have done things.
Good luck,
Derek.

2,334

(2 replies, posted in General)

Hi Dmitry,
Understood and thanks for your reply.
Derek.

2,335

(2 replies, posted in General)

Hello Dmitry,

I have a couple of questions about the new 'in-grid' editing features in MVD 3.0. 
1.  Is it possible to delete a record 'in-grid'? ('in-grid' record creation and amendment works well).
2.  If I use the keyboard (TAB or ARROW keys) to move from cell to cell in the grid, date related columns and combobox related columns do not display the 'open dropdown' icon';  I have to use the mouse and click in the cell for this to be displayed.  Is there a keyboard shortcut / keyboard combination that will do this?  (in other software, it is often the 'ALT+DOWN ARROW' or F4 but I have tried all the obvious combinations).
The new version is looking very good - much faster and easier to create projects.
Thanks,
Derek.

2,336

(31 replies, posted in General)

Good Evening Dmitry,
Thanks for the latest version of MVD - it looks excellent.
The in-grid editing feature is a MAJOR improvement and will change the way many of us create our projects - much faster, much simpler.  I already want to re-write some of my projects (oh no!!).
I am just doing some basic testing to find out more about it and I have two questions
1.  It is possible to create a record 'in-grid' and it is possible to edit a record 'in-grid'.  But is it possible to delete a record 'in-grid?
2.  If I use the keyboard (TAB or ARROW keys) to create or edit records 'in-grid', any combobox that is associated with a column does not display its 'icon' (to open combobox);  I have to switch to using the mouse for this to be displayed.  Is there a keyboard shortcut / keyboard combination that will do this n MVD?  (please see attached screenshot).  In other software, it is often the 'ALT+DOWN ARROW' or F4 but I have tried all the obvious combinations.
Thanks again,
Derek.

2,337

(8 replies, posted in General)

Hi John,
On your frmmain.gridinvoices, you specify packageofcare as your table;  I think this should be invoices.  You then need to add the packageofcare.id onto the grid so that it can link through to pick up the client details (see attached).
On a quick 2 minute glance, there are actually a few things that jump out as possible problems (eg, there is no relationship on the invoicedetails table up to the invoices table, invoices that don't belong to any client, packages of care that don't belong to any client etc etc), and I think (not 100% sure without checking it) that when you add a bit more test data, you might find you'll get issues with data being displayed more than once on some of your forms. 
But you may be aware of these already.
Derek.

2,338

(8 replies, posted in General)

Hi John,
From what you are saying, I suspect it's one of a couple of things.  Rather than guess (and get it wrong and therefore just cause confusion!), can you upload your project and /or take a couple of screen shots and annotate where the problem is.
Derek.

2,339

(8 replies, posted in General)

Hi John, Hi EHW,
Don't worry about it - we've all been there!
When I replied, it was more to show you the calculation of the dates and a response to your question about drawing lines, boxes etc.  So for speed, I simply populated the table that the combobox is based on using SQLITESTUDIO rather than MVD (which is why there is nothing to see)!
As this has perhaps added a degree of confusion, I've re-done it wholly within MVD which will enable you to now see where you maintain your RAIT, ICT and whatever categories.  And because I've done it 'properly' this time (LOL!), rather than hard code the number of days into the script, you can set this as part of creating your categories.
Have a look at the example and I think it will become clearer.
Derek.

2,340

(3 replies, posted in General)

Hi Adam,
I think that the 'hide/unhide' is actually working. 
What seems to be happening is that when you click 'add', the panel opens, then a new (blank) record is being saved (you can see it being added to the tablegrid) and then the panel is being hidden again (as instructed in the script).   
What I don't know is what is triggering the 'save'?  Perhaps trying to use the same form to display the tablegrid and the data entry fields PLUS using 'pagecontrol' and 'tabsheets' is causing some issue;  I don't think I've seen anyone else use a combination of one form, pagecontrol and tabsheets before and whilst in theory it should be possible, it's maybe not been tested as thoroughly. 
It might be interesting to see if you have the same problem if you rework your example without using pagecontrols.
I know it's nice to try and do everything on one form but I've found it causes additional problems (blank records, duplicate records, clearing fields, tablegrid refreshes) to the extent that I've reverted to using separate forms for tablegrids and data entry, knowing that the in-built MVD checking is very tight.
Derek.

2,341

(8 replies, posted in General)

Hello John,
MVD offers many different ways but I'd do it something like this (see attachment);  I've cut corners by creating the drop down directly in sqlite and hard coding the date intervals (which you wouldn't normally do) but it gives you the general idea.
Lines can be drawn to separate areas using panels (defined as thickly or as thinly as you want) but you can also use panels to wholly enclose areas.  Another option is to use groupboxes (although you don't have the same choice for changing colours). 
Hope this gets you started.
Derek.

2,342

(4 replies, posted in General)

Hello Gtacrazy,
The attached example should show you how you might do this.
Please remember that MVD is very flexible and there will also be other ways to do this.
If there are things that are not clear, just ask the Forum and I'm sure someone will be able to help.
Neil.

2,343

(20 replies, posted in General)

Hi Adam,
Not sure if this is the sort of thing that you're meaning for the first part of your post (moving records from one grid to another) but I imagine it will be enough to get you started;  please see attached.
But I'm out of ideas as to how you'd achieve the second part (moving rows up and down).
Derek.

2,344

(5 replies, posted in General)

Hello Zizou, Hello Mathias,
Nice example, Mathias - I'm sure it will help to get things started.  Love the minimalist script (ie none!!) - one day, all projects will be like this - LOL!
Derek.

2,345

(12 replies, posted in General)

Hi Adam,
I'm a bit confused (often happens!).  In your earlier post you said you:

"also wanted to prevent user entering a minus figure in Edit1 with following code but didn't work

and your error message you wanted to display was

Starting balance value must be bigger than zero'

This is what I based the example on that I attached to you.
But in your latest post, you quote two calculation examples where the starting balances (Edit1) can be negative. 
Anyway, even if not mathematically correct, it should still enable you to see how to write the code for the situation you face.
Derek.

2,346

(12 replies, posted in General)

Hi Again Adam, EHW,
Just sent my response and then saw that EH has already replied. 
Sorry about that.
Derek.

2,347

(12 replies, posted in General)

Evening Adam,

Getting the calculation to fire off correctly is trickier than you first think - what sequence is the user entering the figures in, do they 'tab' or 'backtab', do they backspace out a field (leaving it empty / not null / zero).
Anyways, this is the way I think I'd do it.  Probably other ways as well.
Derek.

2,348

(2 replies, posted in General)

Hi Adam,
Try something like this;
procedure Form1_Image2_OnClick (Sender: string);
begin
  frmdetails.show;
  frmdetails.pagecontrol1.ActivePageIndex := 1;
end;
Note that tabsheet1 is pageindex0, tabsheet2 is pageindex1 etc etc
Derek.

2,349

(11 replies, posted in General)

Hi Again,
What I forgot to do (duh!) was to set the 'first item empty' object property to 'false' for the comboboxes in my earlier example;  it's not a show-stopper, but nevertheless, apologies.
Derek.

2,350

(11 replies, posted in General)

Hello Adam, Jean, Mathias,
As always, I try to keep things simple (so I can understand them!!).  So I would...
1.  use a combobox;  it forces the user to make just one choice (like a radio button) but you don't have to add any script.
2.  use a groupbox to hold edit and memo fields so you only need to set the enabled property once (for the groupbox, not for each field).
Also, i would colour code the edit and memo fields as a visual reminder to the user that they were / were not available depending on the combobox value.
In the attached example, I've used different drop down values for the combobox response depending on the question - it would be easier just to use 'yes/no' but it makes it a bit more specific.
Hope this gives you some ideas.
Derek.