I have mentioned something similar before but couldn't find any solution.


There is an issue with MVD when two stages of adding a new record used. I can understand that in order to save second level it needs to save first level after initiating second level add new records as a blank or incomplete record. It's all fine up to here. However, when I click on cancel button on level 1 form, I'd like blank or incomplete record to be deleted rather than deleting them manually on main form tGrid.


Please see attached MVD sample project student performance db.
1. On main form click on add student button
2. On student form I made last name field required to avoid saving totally blank record. Then click on add button to add a test after putting some value in last name field.
3. On test window I add some details or cancel without adding any details.
4. Back to student form, I decided not to save the record by clicking on CANCEL button but MVD saves the record. What I'm looking for on click of cancel button, record is deleted and now shown on main form tGrid.

Cancel delete applies when adding new record not when editing existing record.


------------

702

(17 replies, posted in Script)

AD1408 wrote:

... I couldn't find a way to customize newly added numbers such as their distance from minutes ellipse, changing font size, font color, using less numbers and using different fonts?


Hi Dmitry,
Are above complicated and requires too much of your time?

703

(2 replies, posted in General)

Hi EHW,


Thank you very much..............................
Appreciated.....

704

(2 replies, posted in General)

I'm almost certain this has been asked before. I was looking for a script that shows a warning message when cancel button clicked while adding / editing a record but couldn't find.



During adding / editing; if any field of the record changed and user clicks cancel button with an action to close form, app shows warning message something like "Are you sure you want to disregard changes?" Clicking No on warning dialog takes user back to the form he was working with and clicking Yes would close the form without saving changes.

705

(17 replies, posted in Script)

Great stuff Dmitry!!!
Thank you very much.................


You put the numbers outside the minutes ellipse, that's nice... I couldn't find a way to customize newly added numbers such as their distance from minutes ellipse, changing font size, font color, using less numbers and using different fonts?

706

(17 replies, posted in Script)

Thanks a lot Dmitry.............


Script is beyond me in most parts. How can I change clock face, size, use numbers such as 9-3 12-6 or IX-III XII-VI etc. instead of o? And resizing pens length according to clock face?

707

(17 replies, posted in Script)

I was having a look at Dmitry's clock sample app. It showed date and time together. Played with it a bit as a learning exercise to show date and time separately. Ended up with this digital clock:
https://s17.postimg.org/5btjzf4wf/zzzzz_Temp6.png


I guess making an analog clock is not that easy. Perhaps somebody can take on the challenge to make a nice looking analog clock?

708

(9 replies, posted in General)

Thanks a lot Derek...........................


I love derekscroll... in this case myscroll as you have changed it to demonstrate it could be any name.
I didn't need a tgrid on adding editing details  form (frmEmpployee), so I deleted it. Added couple of lines for save button on frmEmpployee so that it focuses on newly added record and display details.


-------------

709

(9 replies, posted in General)

Hi Derek,


This one could have been in it's own topic. It's partially connected to this thread.


Showing record details without SQL script works fine when adding/editing on same form. I was wandering is it possible to do same (without SQL script) when adding/editing done on different form?


Please see the sample project attached.

710

(9 replies, posted in General)

Hi Derek,


Thank you very much for the latest update..........
Very kind of you and appreciated


I liked your custom/global procedure that makes tGrid auto row selection great if I understood correctly. In this case there is no need for refresh after delete/edit/ save.


I prefer the approach of; if a button is not clickable then it should be displayed as disabled. I'm not saying it's better but just a personal preference.
So, I did buttons enable/disable with panels version. I also added clear script to cancel button. If I didn't make a mistake attached sample project is exactly what I wanted do. I couldn't have done it without your help.


Is there a reason why you mix the 'enabled' and the 'visible' properties?  Enabled=false means that the user sees the object but can't click into it whereas Visible=false means that the user can click into it but then can't type.  Personally,

I may have made a mistake without realizing. My understanding of "Enabled=false means that the user sees the object but can't click" and Visible=false means that the user cannot see or click into the component where property visible set to false. i.e. I put a button on a form with Visible=false, on run I cannot see or click on it. Perhaps you are trying to explain something else and I'm not getting it?

711

(9 replies, posted in General)

Hi Derek and zahar2002,


Thanks a lot guys.......................


I have done it with enable/disable buttons only. It seems to be working OK but I'm not sure if all correct and not missing/overlooking to something. Updated sample project attached.


Derek,
1. I couldn't get working to display record details on mouse click and scroll without SQL in my sample project (using buttons enable/disable?
2. I have no idea about writing custom procedure like derekon without (Sender: string) etc. When you have time your short tutorial would be much appreciated.


-------
Edit: I realized that I missed enabling/disabling fields, therefore updated the sample project accordingly.

712

(9 replies, posted in General)

I understand this one requires some script which is beyond me at present. I hope somebody kind and capable enough can help.


https://s28.postimg.org/lsiu0dyul/zzzzz_Temp5.png


Adding/editing and saving on same form not by hiding buttons, panels etc. but actually making buttons and fields disabled as appropriate.


Please see ref. image above...
On default state Add, Edit and Delete buttons are active but fields and buttons under "Add / Edit Record" panel are disabled.
If user clicks Add or edit button  fields and buttons under "Add / Edit Record" panel are enabled.
On add/edit state when user click on save or cancel button then it returns to default state.
Clear button is just for clearing fields.


A sample project attached.

713

(8 replies, posted in General)

bemorhona-qt wrote:

Your have misunderstood me, when I said OnClick, I meant - procedure Form1_WORCESTER_OnClick (Sender: string);
Your procedure is not right, change it and you will see the result.


Got it... Now it works all fine...


Thanks a lot for your kind help bemorhona-qt.............................

714

(8 replies, posted in General)

bemorhona-qt wrote:

you can change the size of form1 on click, try it yourself, if not then i will help you. also attach your real project and describe what you want, it wuould be easier to help you.


Tried the following but no luck

procedure Form1_OnClick (Sender: string);
begin
      if Form1.Worcester_L.Visible then
         begin
              Form1.Worcester.Caption:= '- WORCESTER';
              Form1.Worcester_L.Visible:= True;
              Form1.Height:= 331;
         end;
end;

I haven't started the project I'm thinking to use accordion. The idea is not to show every fields on the form to user immediately so that they would choose which fields are needed for the task in hand.

715

(8 replies, posted in General)

bemorhona-qt wrote:

See the attached file. I also added another feature, I think you will like it.


Nice work bemorhona-qt... Thank you very much..................


Only part remains that when accordion content is bigger then to expand the form size to fit in the form but I can live with what you have done.


Here is the panels version example that requires resizing the form when expanded

716

(8 replies, posted in General)

Hi Derek,


Thank you very much for the example.


I like it to do bit more. Here is the illustration of what I wanted do:


https://s31.postimg.org/ekph0x0qz/zzzzz_Temp4.png


As you can see form is expanded where not enough space and following accordion header also pushed down.
Also when new accordion header expanded, previous open accordion is collapsed.

717

(8 replies, posted in General)

Hi Dmitry,


Is it possible for us to display data in accordion style as used in MVD (db tables / currency field type) ? If so, how?

https://s31.postimg.org/8xhvqt0zv/zzzzz_Temp2.png

718

(1 replies, posted in General)

Hi v_pozidis,


Perhaps you may find some details here:
http://myvisualdatabase.com/help_en/


More help links are here:
My Visual Database → General → Documentation in English

719

(11 replies, posted in General)

Hi Derek,


Thank you very much for the example. It doesn't suit the project in hand I'm playing with due to way too many fields for schools table. It's difficult to manage over 500 fields on a single table. However, your kind example is appreciated as I learn a lot from your posts (remembering all with my one cell brain is another matter tho.. lol)


Derek, is your example one form doable without additional two forms you have used?


EDIT:  I think I managed to work out my issue described below by using onShow button.click.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Now I stuck with another issue. I thought this would be easy but couldn't do it. Basically, I'm trying to copy ItemX and ItemY field values from one form to another and display them on form1 relevant section. Please see the image below for better explanation as to what I'm trying to do.
https://s8.postimg.org/xezmscuth/zzzzz_Temp1.png


Updated sample project attached:

720

(6 replies, posted in General)

AD1408 wrote:

Following refresh after add/edit/delete script returns - Undeclared identifier: "Form1_OnCellClick.."

procedure Form1_Button3_OnAfterClick (Sender: string);
var
i: integer;
begin
      i:= Form1.TableGrid1.RowCount;
      Form1.TableGrid1.SelectedRow:= i-1;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

procedure frmAdd_Button1_OnAfterClick (Sender: string);
begin
      Form1.TableGrid1.dbItemID:= Last_Insert_id;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

I have checked form, tGrid and buttons names... Cannot get rid off it.


bemorhona-qt's sample project fix works but this one is not. What am I missing???


As it was asking for onCellClick so I added an empty onCellClick procedure as below and naturally error disappeared:

procedure Form1_TableGrid1_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
end;

procedure Form1_Button3_OnAfterClick (Sender: string);
var
i: integer;
begin
      i:= Form1.TableGrid1.RowCount;
      Form1.TableGrid1.SelectedRow:= i-1;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

procedure frmAdd_Button1_OnAfterClick (Sender: string);
begin
      Form1.TableGrid1.dbItemID:= Last_Insert_id;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

However, I'm not sure the above is correct way of doing this... Is it possible to put refresh script above under one procedure?

721

(11 replies, posted in General)

Thank you very much Dmitry...................................................
It does the job as I wanted.


But if one school can have only one library, you should use one table for school and library. Because if you create two library for one school, which library you should show in tab "School Library"?

School has too many fields (well over 500) to manage in one table, hence I wanted to breakdown into different tables. If school has multiple entities like in students, then I use secondary table. In this example library is just one of many school details. Anyhow, thanks for the heads up.

722

(6 replies, posted in General)

Following refresh after add/edit/delete script returns - Undeclared identifier: "Form1_OnCellClick.."

procedure Form1_Button3_OnAfterClick (Sender: string);
var
i: integer;
begin
      i:= Form1.TableGrid1.RowCount;
      Form1.TableGrid1.SelectedRow:= i-1;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

procedure frmAdd_Button1_OnAfterClick (Sender: string);
begin
      Form1.TableGrid1.dbItemID:= Last_Insert_id;
      Form1_TableGrid1_OnCellClick('',0,0);
end;

I have checked form, tGrid and buttons names... Cannot get rid off it.


bemorhona-qt's sample project fix works but this one is not. What am I missing???

723

(11 replies, posted in General)

Hi Dmitry,


Looks like your help needed here please, especially for the issue number 1 on my previous post  #6

724

(11 replies, posted in General)

I have updated the test project. Please see the attached...


1. I have changed courses table to library so that it makes better sense in respect of what I'm trying to do. Issue of displaying library details of selected school on form1 / School Library tab?


2. Another issue I have noticed. When double click on a record on SCHOOLS tGrid it opens two form; frmSchool and frmLibrary. When clicked on edit button it opens the correct form only. How can we make it to open active tab specific form on doubleclick too? This item is SOLVED thanks to Dmitry's script. However other items are still not resolved.


3. I have tried to use different method (thanks to bemorhona-qt) to refresh records display after add/edit/delete. However, my implementation works partially. On schools tGrid/details only delete refreshes.  On Students tGrid Edit and Delete refreshes but not Add. Perhaps bemorhona-qt could offer a help again?


4. I couldn't find the way to work DateTime component spinbox arrows?

725

(11 replies, posted in General)

Thanks a lot Derek...........


Perhaps courses was a bad subject to pick. It could be school garden details. What I want with courses is to display course details  belonging to a selected school without courses tGrid. Imagine each school having only one course.