Hello Mathias,
Thanks for your comments.
I thought about checking for duplicate entries but at the same time, I wanted a solution that didn't involve a script; personally, I think duplicate checking is something that the core product could handle.
I have tidied up my 'lookups' approach (I now call it "attributes" - LOL!) and have created a simple .txt file that contains the generated code to create the 'attributes' forms and the generated code to create the 'attributes' table and as many relationships as my project requires.
Now when I am creating a new project all I have to do is:
1. copy and paste the relevant section into the tables.ini file (I create 10 'attribute' look-ups by default)
2. copy and paste the relevant section into the forms.xml file
It takes less than 60 seconds after which I have fully working forms, an 'attributes' table definition and all the relationships. It is a big improvement on my productivity!
Hope some of this can be of help to you.
Thanks again for your interest.
Derek.
2,726 2016-01-25 11:50:11
Re: New object property (9 replies, posted in General)
2,727 2016-01-22 02:14:40
Re: New object property (9 replies, posted in General)
Hello EHWagner,
Thanks for the information. I have tried the suggestions from Mathias and yourself and both work well; it now gives me a couple of further options when writing new projects.
I don't actually have an objection to dropdown lists being connected to a database per se, simply the number of additional tables and forms you have to create and the time it takes for what is essentially an attribute (as distinct from a proper related record).
What I came up with in the end doesn't have any script at all and works entirely off 1 table and users are able to add new values to the various lists without me getting involved (which is always good news!).
I've attached a small demo based on the project that I first used this approach on - it's easier than trying to explain - but you can see all the 'dropdown lists' in their combo-boxes working on form2!
If you can think of any improvements, please let me know (for example, I was trying to use this approach in conjunction with 'parent combo-boxes' but couldn't figure out a way that saved any time over doing it in the usual manner).
Derek.
2,728 2016-01-20 16:36:20
Re: New object property (9 replies, posted in General)
Hi Mathias,
I really like the script! I'll copy my project and try it your way and compare the two approaches.
My own solution doesn't use a script at all. I create multiple links to a single 'lookups' table and then put filters on each of the comboboxes. It saves a lot of time (for my latest project, it is 4 forms instead of 14!). And, of course, if new look-up values are needed, they can simply be added like any normal data.
Thanks for your interest and help - much appreciated.
Derek.
2,729 2016-01-20 01:07:17
Re: New object property (9 replies, posted in General)
Hi Dmitry,
Understood and thanks for getting back to me.
I've managed to put together a bit of a work-around now that will be fine for most of the things I need to do.
Derek.
2,730 2016-01-19 18:24:06
Topic: New object property (9 replies, posted in General)
Hello Dmitry,
The latest version of MVD now has many object properties to make development much quicker.
Can I ask you to consider adding a "list" property (like in Excel, or Google Docs 'List of Items') where you can create a list of comma separated values and present them as a drop-down pick-list.
This would remove the need to create tables just to hold a small number of rows, remove the need to create relationships between the tables and remove the need to create additional display (tablegrid) and maintenance forms. It would also be a lot easier for new Users.
On a project I am working on now, I have to add tables plus links and all of the forms for 12 comboboxes (see list1.jpg); with a "list" property, I estimate it would only take me 5 minutes to set them all up.
I appreciate that some of MVD's features are always going to be of more interest than others but I think something like this would benefit almost everyone. Some of us are now starting to create quite large projects and anything that reduces size and complexity has to be a good thing.
Thanks,
Derek.
2,731 2016-01-19 13:59:36
Re: Start-stop-elapsed day time (15 replies, posted in Script)
Hello Carlo, Thierry, Dmitry,
I did a similar small project a while ago (with the help of some code from Mathias).
I have changed my project a bit to show elapsed hours as well as days and have attached it for you to have a look at.
I added a few rows of sample data and it still seems to be working but haven't put any error checking in place (for example - is the end date before the start date etc etc) but that wasn't your question.
I hope this helps you,
Derek.
2,732 2016-01-18 01:25:59
Re: Latitude and Longitude with MVD (2 replies, posted in Script)
Hi Jean, Dmitry, Everyone,
Hope you are well.
I'm not sure if this is the sort of thing that you are trying to do - it was something I was working on a few months ago. I have made a quick project for you to have a look at.
You can enter the latitude and longitude co-ordinates in different formats and it accepts all the ones that I am aware of (for example, 48.858261, 2.294507 OR 48° 51' 29.7396'' N, 2° 17' 40.2252'' E).
Hope this helps,
Derek.
2,733 2016-01-13 15:28:05
Re: MVD Latest Version 2.3 (3 replies, posted in General)
Hi Dmitry, Hi Thierry,
It's nice to be aware of the improvements that are planned but as Thierry says, maybe they could be greyed out (or something like that) until they are ready. Otherwise users will be messaging you in the forum either saying "how do I do this......" or "this isn't working properly....." when it's simply not been fully implemented yet.
Thanks for the explanation and I look forward to when these two features in particular go live.
Derek.
2,734 2016-01-12 23:12:49
Topic: MVD Latest Version 2.3 (3 replies, posted in General)
Hello Dmitry, Everyone,
There are a lot of new features in MVD 2.3, particularly object properties, that should be very useful and save a lot of time instead of writing scripts. But understanding what they all do is difficult as some of them do not seem to be working (at least as I would have expected).
In particular, there are a couple of tablegrid properties that I cannot get to work.
1. tablegrid option "goinput". If I understand this correctly, this is an 'in-grid' insert option. But how do you save any data that you input using this option? And if you are inputting a relational field, how do you get an 'in-grid' combobox to select options?
2. tablegrid option "gosecondclickedit". Is this some type of 'in-grid' editing and if so, how should it be set up? I have selected it and nothing happens.
Can you please explain how these 2 properties work?
At the moment, I feel I am not able to use MVD to its full capabilities; I wonder if it would be useful if you could take one of your "ready to use projects" (for example, "Accounting Ink Cartridges") and re-work it to demonstrate many of the new features of Version 2.2/2.3. It might help a lot of users.
Thanks as always,
Derek.
2,735 2016-01-10 23:45:08
Re: Problem with calculated field (2 replies, posted in General)
Hey Dmitry,
That works perfectly now.
Thanks for the help - and for the super fast reply.
Derek.
2,736 2016-01-10 23:32:45
Topic: Problem with calculated field (2 replies, posted in General)
Hello Dmitry,
I hope you can help. I am using a calculated field (medicine.stock) to show, for each drug in my 'medicines' table, the (sum of drugs in) - (sum of drugs out). This is the calculation:
(select sum(inwards.inqty)
from inwards
where medicine.id = inwards.id_medicine)
-
(select sum(out.outqty)
from out
where medicine.id = out.id_medicine)
This works as I want but ONLY after I have received some drugs ('inwards' table) and despatched some drugs ('out' table) - see rows 1-5 in the attached screen-shot (medicinechest1.jpg). But if I have only received drugs and NOT despatched any, the calculation is not working - see rows 6-7 (medicinechest1.jpg). I need to do some test for zero but I cannot get the syntax right. Any ideas?
I'm using Windows XP and MVD 2.3 beta.
Thanks,
Derek
2,737 2015-12-24 09:59:10
Re: Merry Christmas (8 replies, posted in General)
Good Morning Everyone,
Not sure if anyone knows how to help......
I am trying to use Mathmathou's ' "Merry Christmas" procedure in my script and it keeps coming up with the following error -
"Undeclared Identifier at 25 December 2015".
I have tried replacing merry_christmas.tablegrid1.dbupdate with happy_new_year.tablegrid1.dbupdate but it still doesn't work!
Still, I am sure someone will have a suggestion or be able to help - that is what is great about MVD, Dmitry and the people in the forum!
Best Wishes,
Derek.
2,738 2015-12-21 01:47:50
Re: button background color? (11 replies, posted in General)
Hello Dmitry,
I am still a Windows XP user and I have never been able to change the text or background colour properties of buttons or comboboxes.
Do you mean that these features exist for Windows XP but only with MVD 2.2 and upwards?
If these features exist for Windows XP with earlier versions of MVD, can you please provide an example of how to do this.
Thanks,
Derek.
2,739 2015-12-17 16:49:46
Re: File menu (29 replies, posted in General)
Hi Roger, Dmitry, Jean and any one else.
As I understand it,
1. The standard menu items appear ONCE AND ONCE ONLY in MVD - on the first form that is called by your application.
2. You can remove the standard menu items with a few lines of script which is attached to the first form of your application; and because the standard menu items ONLY appear on the first form, there is no need to attach the same few lines of script to any other form.
3. You can replace the standard menu items with your own menu items by script; and following the logic from above, the script to replace the standard menu items is only attached to the first form of your application because this is the ONLY PLACE where it appears.
4. Dmitry has written a script that allows the replacement menu items to appear on a form OTHER than the first form in your application. In other words the replacement menu items can now appear on Form1 OR Form2 OR Form3 etc etc.
5. However, I believe the actual requirement is that the replacement menu items appear on Form1 AND Form2 AND Form3 etc etc.
I have attached a small project just to clarify what I think Roger is trying to achieve, using buttons that look a bit like menu items(!) that switch between forms in any sequence!!
I have already used this approach in an application where users want to swap between forms and whilst it works, I will be the first to admit that it isn't particularly clever.
If this IS the sort of thing that Roger is after and using the attached project as a template, maybe someone could come up with a better way of achieving this. Or maybe Dmitry can amend the 'Mainmenu on Form2' script to work across all forms - I had a brief attempt and failed miserably - LOL!
Let's all try and work together on this as I'm sure many of us would find it very useful.
Derek.
2,740 2015-12-16 18:15:48
Re: Calling on SQL Experts (20 replies, posted in SQL queries)
Hi EHW,
Fully agree with your comments about MVD - good product, pretty robust but with so-so documentation, an over-reliance on scripts to do some pretty basic things and an over-reliance on Dmitry (which is not a criticism whatsoever - I think he's pretty amazing the way he helps people with so many questions in so many languages, as well as developing the product).
I had a quick look at the latest version (7 day trial) and a lot of the functions you previously had to script now seem available as object attributes but some areas are still a bit light (eg, certain tablegrid attributes, particularly when you consider how 'core' the tablegrids are to the way MVD works).
Having said all that, I've not found any software that comes close to it for it's balance of power, price, rapid development and relative ease of use.
Derek.
2,741 2015-12-16 01:56:24
Re: Calling on SQL Experts (20 replies, posted in SQL queries)
Hi EHW,
That all makes perfect sense now.
I actually wrote something not too dissimilar many years ago and the concept of the 'leads' table is bizarre - it's virtually stand-alone with only a very loose relationship to any of the other tables in the database.
In the end, I think I 'cheated' by having just a 'clients' table but one of the rows in the 'clients' table was for a client called 'Leads' and if any of the queries against the 'Leads' client got firmed up, I then created it as a proper client and copied the data over.
It sounds like quite a large project you're undertaking. Best of luck and keep us updated with how it's going - it looks pretty interesting.
Derek.
2,742 2015-12-16 00:04:44
Re: Add items to a combo box (6 replies, posted in General)
Good Evening Jumper,
It's 'standard' MVD which is why the script is empty (apart from the "hello world").
Using the example I knocked up, the 2 digit code and the description are fields in a table called 'states'; it is the table that gets populated, NOT the combobox. The combobox is just a way of letting you pick a value from the 'states' table. It is not a table itself and doesn't hold any data.
Have a look at the attached screenshot and follow it through.
On Form1 click the 'STATES TABLE' button. This takes you to Form4 which is a list of rows in the 'states' table that have been added so far.
Click the 'ADD STATE' button to create more entries in the 'states' table..
When you have finished, go back to Form1 and click on the 'ADD' button to go to Form3 where you start adding suppliers.
This is where you see the combobox in action - remember, it is simply a convenient way of presenting you with a pick-list of values held in the 'states' table.
Hope this clears things up a bit and if you need any more help, just shout.
Derek.
2,743 2015-12-15 18:50:40
Re: Add items to a combo box (6 replies, posted in General)
Hi Jumper,
Apologies if I've misunderstood your question.
You can't (easily) populate entries directly into a combo-box (like in Excel). Entries need to be added to a table first like any other data field(s).
Once created, these entries are then referenced by using a combo-box on the form where the data is required.
I've attached a knock-up (it's easier to show it than to explain). I've used 3 different 'styles' for the combo-box entries with 3 discrete 'save' buttons:
1. the 2 digit state code
2. the state description
3. the two concatenated together
Obviously, you wouldn't normally have all 3 on the same form, I've just done it to show you the options you have.
Hope this helps,
Derek
2,744 2015-12-15 12:56:39
Re: launch browser to look up a zipcode in Google maps (9 replies, posted in General)
Hi Jumper, Mathias,
I've been using www.google.com/maps/place for a while now in an application and it works fine.
In England, we use postcodes that take you straight to specific streets so it is great for cross checking data.
In the application, I build 2 urls from my address data:
1. a url using just the postcode which, when clicked, lets me confirm the street and town.
(eg. www.google.com/maps/place/wv95lj)
2. a url concatenated from the street and town which, when clicked, shows me the associated postcode.
(eg www.google.com/maps/place/lesscroft+close,+wolverhampton)
While the postcode search is perhaps more relevant to England, the street and town search works world-wide. For example,
www.google.com/maps/place/armitage+close,+red+deer (in Canada)
www.google.com/maps/place/lynne+place,+longview (in USA)
www.google.com/maps/place/carrer+san+francisco,+altea (Spain).
Hope this helps others with similar requirements.
Derek.
2,745 2015-12-14 23:27:17
Re: Calling on SQL Experts (20 replies, posted in SQL queries)
Evening EHWagner, Dmitry,
If you are going to keep changes and deletions in sync between the main tables and the copy tables manually, then most of the complications that I foresaw go away (thank goodness!).
To help keep things in sync, I think I'd perhaps use something like auto-generated 'counters' on the parent and child master tables that would then get copied across to the sub-set parent and child copy tables. Matching on the 'counters', you could then use a simple tablegrid to highlight any inconsistencies between master and copy records (where one had been changed but the other hadn't, or where the number of child records belonging to a parent record was different between the master and the copy etc etc).
It's quite unusual to purposely duplicate actual data in a database. Can I ask what your requirement is to hold a PHYSICAL subset of the parent and child tables rather than just creating a VIRTUAL subset by using something like tablegrid filters? Then all of the issues of inserts, duplicate data and keeping records in sync would disappear.
Derek.
2,746 2015-12-13 23:50:44
Re: Enabling / disabling objects depending on the use (16 replies, posted in General)
Good Evening Tcoton,
I have always been puzzled that the attributes of the objects on the form do not get reset when it is closed.
So I end up ignoring an object's default status and set it explicitly one way or the other which takes more time and makes the script longer, but it's the only way I know to make sure it works 100%.
Sorry - I know it's not what you wanted to hear - LOL!
Derek.
2,747 2015-12-12 18:42:26
Re: Enabling / disabling objects depending on the use (16 replies, posted in General)
Hi TCoton, Hi Matthias,
It is also quite nice not just to set various fields to enabled := false but also to change their colour otherwise the user might be tempted to try and click in fields that are still showing 'white' - I tend to use clbtnface to be consistent with other Windows applications where an option isn't available.
I changed the example I did to show this and it is attached. Of course, it is a few more lines of code but if it stops errors and makes it easier to use, then it is worth it.
I'm sorry but I'm not sure what you mean when you ask "what is the function check?"
Anyway, hope this helps.
Derek.
2,748 2015-12-12 01:22:13
Re: Calling on SQL Experts (20 replies, posted in SQL queries)
Hi EHWagner, Hi Dmitry,
I was having a look at your problem (which I think is actually more awkward than it initially appears!).
Creating inserts into the parent-copy and child-copy tables is relatively straightforward. However, I believe Dmitry's example encounters the same two basic problems that I was concerned about. They are:
1. DELETIONS - if you delete a parent record and any child records, presumably you want to check if there are any associated parent and child records in the parent-copy and child-copy tables and have them also deleted. Awkward because both pairs of tables are essentially 'stand-alone' and there is no record-id to relate them, so you are relying on users to also make the same deletions in the copy tables (which they all say they will do but we know they won't !!).
2. CHANGES - if you change a parent record and any child records, presumably you want to check if there are any associated parent and child records in the parent-copy and child-copy tables and have them also changed. Again, awkward. In Dmitry's example, a change to the parent and / or child record creates an INSERT in the parent copy table. But to be fair, I think Dmitry's example is only currently intended to perform inserts.
Taking the two problems together, you could find that, rather than the copies being sub-sets of the original tables, they will quickly start to hold completely different records.
Still, it's an interesting problem and I'm sure there's a way of doing it. I'll let you know if I come up with anything.
Derek.
2,749 2015-12-11 14:36:57
Re: Calling on SQL Experts (20 replies, posted in SQL queries)
Hello EHWagner,
I found your problem far more interesting that what I'm supposed to be doing right now - LOL! So......a couple of questions.
1. Will the second parent table ALWAYS be populated (so it can be automatic) or just occasionally (so it would be a manual request)?
In other words, if the first parent table has 1000 rows, will the second parent table also have 1000 rows or only a subset?
2. Will this also be true between the first and second child tables?
The reason for the questions is that I can see a scenario where you don't always want the parent record to be copied but when you DO copy a parent record, you would ALWAYS want the child record(s) to be copied.
3. Is this mainly to avoid having to enter data twice?
I've mocked up a couple of quick solutions but would just like to know the answers to 1. 2. and 3. above before I see which is most suitable.
More generally, I'm intrigued as to why you need to create the additional parent / child tables in the first place.
Derek.
2,750 2015-12-11 13:58:47
Re: Enabling / disabling objects depending on the use (16 replies, posted in General)
Hi TCoton, Mathias,
Yes, it can make the form look unbalanced.
You could replaced the xxx.visible := false with xxx.enabled := false. That might make it look better.
I've attached an example - it might not have all your conditions, but the principle is the same.
Derek.