2,426

(4 replies, posted in General)

Hello Nrmudli,
I would do it this way (but there are other ways too)
//********************************
procedure formX_OnShow (Sender: string; Action: string);
begin
  if action <> 'NewRecord' then form2.editX.readonly := true;
end;
//********************************
Hope this helps,
Derek.

Hi Megood70,
Try editing the .vdb file (use Notepad or something like that).
Change the line
Version=N
and replace N with the version of MVD you are using.
Derek.

2,428

(13 replies, posted in Script)

Hi Lee,
I took a look at your sample score card and mocked up a screen that tries to emulate it, just to prove to myself that it can work!
It's not how you'd typically choose to structure your data nor your forms if you were starting from scratch but I appreciate that you are having to work with the existing score card layout.
A lot of the confusion is because the score card is laid out in a grid (so most people immediately start thinking 'columns' and 'rows') but really what you have is 1 record with a large number of 'edit fields' holding repeating data that just happen to be arranged in a grid format!
Anyway, I've attached a 'mock-up' for you to see how it could work;  the script isn't quite as bad as it looks - there's just a lot of repetition in it and on the form I've used panels as an easy way to keep groups of 'edit fields' together rather than having to re-arrange them one by one! 
The down-side to that is that your 'tab ordering' is sub-ordinate to the panel so when you come to do it for real, you might want to avoid that.
I have just 'made up' a player handicap and held it on the players table but that was simply because I didn't have the time to play around with it;  as you explained it, I understand the handicap calculation and there's probably a couple of ways to tackle it, none of which would be difficult.  I think proving that you can re-create the 'score card' form with it's many edit fields in a 'grid style' and getting it to update as you work on it, is the main thing.
Hope it gives you some ideas and moves you forward a bit.
Derek.

2,429

(13 replies, posted in Script)

Hi Lee,
Perhaps you could attach an image of the standard scoresheet that is used, with some sample data filled in so we can get a better handle on what it looks like - ideally annotated to show how the handicaps are worked out.
Derek.

2,430

(13 replies, posted in Script)

Hello Lee, Dmitry, the World!
Not sure if I'm fully understanding the problem (and I certainly don't know anything about 8-ball or 9-ball!) but it sounded more interesting that what I was doing - LOL! - so thought I'd have a quick go and see how it could work.
If there are a set number of games in a match, I'd certainly have a 'match' table and then a 'games' table to record the scores in each of the games in that match (sorry if my terminology is all wrong).
If you do it that way, you could use a combination of calculated fields (to sum what is, in effect, the rows) and basic tablegrid functionality to sum the columns.
It seemed easier to knock something up rather than talk around it, so attached is a very rough and ready  example of how you could perhaps achieve it.
The script is largely to automate things - the main functionality can be got from standard MVD which keeps it simpler.
I haven't bothered to do anything about calculating the handicaps or looking at your treasury issues - they seem subordinate to the main problem of getting the basic scores logged in.  Also, the data I've put in will make little sense and there is zero validation (checking match dates to season start and end dates etc etc) but that will presumably come later.
Even if I've not understood everything, perhaps it will give you 'food for thought' that enables you to move forward a bit.
Derek.

2,431

(19 replies, posted in General)

From what you describe, I don't see anything that MVD can't handle.
But it's vital to get your data requirements and data structure set up correctly otherwise MVD (or any other product) can't help you. 
Also, you probably need to decide how much you want to do using basic MVD or whether you want to get into scripting (which has more of a learning curve associated with it but will allow you to pretty much do anything (well, within reason!!)).
I've always found it useful to browse through the forum and download other users' projects just to get some basic ideas of what can be done, how to do it, and also to see just how complex some of their projects might be in comparison to what I'm doing.
Derek.

2,432

(19 replies, posted in General)

Hello Lee,
Not sure about the filter as I've never used 1.45.  How do you mean you search on one character?  I imagine it's still possible as Dmitry is unlikely to take functionality out.
In the versions that I've used, the search filters (wildcards, contains greater, less etc) in conjunction with incremental search has always been enough for what I need to do.
Derek.

2,433

(6 replies, posted in SQL queries)

Hello Alin,
Having products with a mix of letters and numbers shouldn't cause you to get that error message.
If your material number is a field in the products table, can you not just set your combobox to show the 2 fields (material number, product no') that you need and sort the combobox by material number.  Or is that what you are doing and it is still too much scrolling.
Alternatively, could you just use a search field (material number) and a tablegrid (standard MVD) rather than writing a script for it?
If you could attach your project, other users might be able to suggest different ways of achieving what you want - I'm sure there must be quite a few - LOL!
Derek.

2,434

(19 replies, posted in General)

Hi Lee,
I've attached your project with the names showing in the tablegrid rather than the record-IDs.  Have a look at the calculated fields in the "dteamssetup" table to see the code.
I'm pretty sure that all of the changes that have been made since you posted in the Forum would still work in Version 1.45 (the last free version) so you could 'back fit' them and it should still be okay.  Unfortunately, I don't have 1.45 on my machine any more to help out.
Derek.

2,435

(19 replies, posted in General)

Hi Lee,
Strange - I think the only other change to your Billiards project that I made was commenting out the script because it was giving me an error (unrelated to your reported problem).
I've attached my working version - I'd be interested to see if you still get errors when you try it.  I added teams (and players) by clicking on "8 ball", then "Set Up Teams" and then "Add".
Derek.

2,436

(6 replies, posted in SQL queries)

Hello Alin,
This is one way you can select a shortname from the combobox and display the corresponding longname in an textbox.
procedure form1_ComboBox1_OnChange (Sender: string);
begin
  form1.edit1.text := sqlexecute('select longname from customers where id ='+ inttostr(form1.combobox1.dbitemid));
end;
Hope this helps,
Derek.

2,437

(19 replies, posted in General)

Hi Lee,
The changes you've made to your table structure that relate to players and setting up teams look fine now with the multiple relationships between dplayer and dteamset.
Can I suggest that you also delete sqlite.db - it almost certainly still reflect the old data structure before you made your changes and will give you various error messages.  Once you've done that, you should be able to add teams and players successfully.
Derek.

2,438

(19 replies, posted in General)

Morning LHimes,
As I understand your posts, the relationship needs to be created in the dteamsetup table pointing to the dplayer table.  The error message you are getting sounds as if you have it set up in the other direction.
However, if you have 4 players in each team and you want to select each player from the combobox, you will, in effect, need to create 4 relationships (one for each player selected).  Whilst that is possible, it gives you a problem in any tablegrids, in so far as the extra 3 relationships will be displayed by their record-id's and not the actual player names.  To get the actual player names, you will have to use calculated fields to pull in the descriptions.
I've knocked up a little example that I hope clarifies the above and highlights the problem.
I think it would be more usual to have a 3rd table (dteamplayer) to hold the details of each player in each team with a relationship between dteamplayer and dteamsetup to avoid the repeated relationships problem described above, but you may have specific reasons for not wanting to do it this way.
Hope this helps,
Derek.

2,439

(7 replies, posted in General)

Hi David, Hi JB,
I was rushing a bit (no excuse!!) and forgot to add a line in the script to re-focus the cursor on the row that has just been 'clicked' to change from 'IN' to 'OUT' and vice versa. 
So, in the script and after the line
    form1.tablegrid1.dbupdate;
please add
    form1.tablegrid1.setfocus;
I know it's just cosmetic but it's a pet hate of mine to have to re-click back into the table all the time.
Thanks, and glad it helped.
Derek.

Hello Again,
Attached is the same project as before.
In the 'form_models' I have added the 'manufacturer combo-box 5 times to show you some examples of how the filter can work.
1.  no filter
2.  exact match
3.  starts with...
4.  contains
5.  ends with
You can also use >, >=, <, <=
Hope this helps,
Derek.

sorry - forgot the attachment!

Hello Again,
Attached is the same project as before.
In the 'form_models' I have added the 'manufacturer combo-box 5 times to show you some examples of how the filter can work.
1.  no filter
2.  exact match
3.  starts with...
4.  contains
5.  ends with
You can also use >, >=, <, <=
Hope this helps

2,442

(7 replies, posted in General)

Hi David,
Bit of a mystery - downloaded the latest version from your link and I still get the same error.
Anyway, from what you described, it was enough to see what you're trying to do.
Attached is the way I'd probably tackle it - and you can see where I've put the table refresh.
I appreciate that the forms and fields are not as you want them but I was working blind not being able to open your project.
Hope this helps,
Derek.

2,443

(7 replies, posted in General)

Hi David,
I wanted to have a look at your project but couldn't open it.  What version are you using?  I'm using MVD 2.5 beta (which I thought was the latest) but the error says you're using a more recent version.
Derek.

2,444

(2 replies, posted in Script)

Hello V_pozidis,
If I understand your problem correctly, you only need to use the 'parent combo-box' feature and do not need to write any script.
Instead of changing your example, it is quicker for me to attach an old example of mine.  Just look at the screen shot and then change your own project in the same way.
However, I think you might need to amend your data tables and your forms slightly.
Hope this helps,
Derek.

2,445

(5 replies, posted in General)

Hello Jean,
I am not sure if I understand your problem 100%. 
When you write ".....value can sometimes be as 25-30", do you mean that each bird could be between 'x' and 'y' - for example, BECASSINE DES MARAIS could be 26-28cms?
If so, then I think you would need to have 2 values in your oiseaux table - taille-minimum and taille-maximum (both defined as integer) and then your SQL query would be something like .....where(taille-minimum > NN and taille-maximum < NN).
Also, some of the ranges in your SQL Queries are overlapping which may cause problems (for example, Raven = 45-71, Buzzard = 57-70) but perhaps this is intentional - I do not know enough about birds!
Derek.

2,446

(5 replies, posted in General)

Hi Dmitry,
Hope you had a good vacation.
Removing repeating data on rows looks excellent but the code is a bit complex. 
Do you think this might be a tablegrid property in a future release or will it stay as a script? 
Also, is it possible to add sub-totalling (like you can with grid footers but at change of non-repeating data) - see attached screenshot? 
Just a thought.
Derek.

2,447

(6 replies, posted in General)

Hello Gilberto, Jean, Thierry,

As Gilberto suggests, a button action to SAVE but also stay on the form and clear all fields ready for the next record to be entered would by useful.
I currently clear my forms in the same way as suggested by Thierry and Jean.
What I also do by script is, after having cleared the fields, add the option to 'repeat' the previous field value by using a reserved character (the '=' is an obvious choice but anything can be used).  Why?  Using Jean's example, you may have 10 different books by the same author so you don't want to retype the author every time.
I also change the field label after the first 'SAVE' to remind the User of this option (I have some  very forgetful users!).
I have used Jean's example (thanks, Jean) to show how I do this.
Hope it helps.
Derek.

2,448

(6 replies, posted in General)

Hi Thierry,
Yes, I guess there are not too many occasions when labels need to go over more than one line!
However, it can be useful, for example as a simple way to add a User Guide / Help.
I create a form (UserGuideForm) with nothing on it apart from 1 label - and the label IS my User Guide;  UserGuideForm is then just called from anywhere by a button with a 'show form' action.
If a project is more complicated, you can have a User Guide form that is specific to each form (ie Form1 has a button to show HelpForm1, Form2 has a button to show HelpForm2 etc etc) or use NEXT and PREVIOUS buttons to call more Help Forms.  It's actually pretty flexible.
Derek.

2,449

(6 replies, posted in General)

Hello Stelios91,
Please see the attached screenshot.
You can make any label multi-line by clicking on the button in the label caption property.
You might need to put in some line-feeds to make it look exactly like you want but is probably what you are looking for.
Derek.

2,450

(4 replies, posted in Script)

Hi Montengr0,
I don't understand what you are trying to do.  Do you have an example, screen-shots or some more information?
Derek.