876

(6 replies, posted in General)

Hi ehwagner,


Thanks a lot for combos fix...........


With the recurring and reminder alarms I need the script so that they work. I cannot write those scripts as yet. I hope one day I'll be able to write them.


------------------------------------
Edit:
Added couple of fields on details form after realizing they were missing.

877

(6 replies, posted in General)

Hi Guys,


I'm trying to do a basic task manager.


I need help with recurring tasks and task alarms.


I used pre-population method for 3 combobox thanks to ehwagner. However, I couldn't get pre-populated combobox saved values displayed on Form1.


Please see the attached sample project:

878

(4 replies, posted in General)

Hi Mathias,


Thanks for the example.....


I can see tricky aspects when there is other components on those panels and if it's a sizable window it may cause further headaches perhaps. Instead of creating panels with script can we use MVD panels and code splitter?


Please see the attached sample project.

879

(4 replies, posted in General)

Hi Guys,


Is it possible to have vertical and horizontal splitter bars in MVD? If so, how?

880

(20 replies, posted in General)

Thank you so much ehwagner.............


Now it works fine. I was starting to think something is wrong in my system.

881

(2 replies, posted in General)

Thank you so much Dmitry............


Works nicely.

882

(20 replies, posted in General)

Thank you so much Dmitry..................


The Category (cbDetailsCategory) combobox is the one not applying sorting.

883

(2 replies, posted in General)

Hi Guys,


Pulling data from other forms into different form script works fine thanks to Dmitry and Derek.


One thing I forgot to ask at that time ws dbFile field type.


Pulling data for text field type, which works fine:

form1.memSearchDesc.text := sqlexecute('select description from Details where id ='+inttostr(form1.tgSearch.dbitemid));

I tried for dbFile type:

form1.dbFileSearch01.DBFile := sqlexecute('select file_link1 from Details where id ='+inttostr(form1.tgSearch.dbitemid));

However, it didn't work. Also tried .File and .Text with no success.


Could somebody correct the above dbFile script please........


ps/. I'm using it for "LinkFolder" type. If script changes when "LinkFile" or "StoreFile" types used please include the additional scripts.

884

(20 replies, posted in General)

Thank you so much Dmitry............


I think I inserted the code in wrong place or incorrectly?


/////////////////////////////////////////////////////////////////////////////////////
/// --> LOOKUPS - COMPONENTS - MOVING ROWS UP and DOWN <--//////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

procedure Form1_Button3_OnAfterClick (Sender: string);
begin
    UpdateDatabase('component');
end;

procedure frmLookups_Button3_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin
    if (frmLookups.tgLookupsComponents.SelectedRow > 0) then
    begin
        id1 := frmLookups.tgLookupsComponents.dbItemID;
        id2 := frmLookups.tgLookupsComponents.dbIndexToID(frmLookups.tgLookupsComponents.SelectedRow-1);

        record_count1 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id1));
        record_count2 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id2));

        if (record_count1<>'') and (record_count2<>'') then
        begin
            SQLExecute('UPDATE component SET record_count='+record_count2+' WHERE id='+IntToStr(id1));
            SQLExecute('UPDATE component SET record_count='+record_count1+' WHERE id='+IntToStr(id2));
            frmLookups.tgLookupsComponents.dbUpdate;
            frmLookups.tgLookupsComponents.dbItemID := id1;
        end;

    end;

    ///When no record selected display info message

procedure frmLookups_Button3_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin

    if frmLookups.tgLookupsComponents.dbItemID=-1 then
    begin
        ShowMessage('You should select a record');
        Exit;
    end;

    if (frmLookups.tgLookupsComponents.SelectedRow > 0) then
    begin
   /////////
end;


procedure frmLookups_Button4_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin
    if (frmLookups.tgLookupsComponents.dbItemID <> -1) and (frmLookups.tgLookupsComponents.SelectedRow < frmLookups.tgLookupsComponents.RowCount-1)  then
    begin
        id1 := frmLookups.tgLookupsComponents.dbItemID;
        id2 := frmLookups.tgLookupsComponents.dbIndexToID(frmLookups.tgLookupsComponents.SelectedRow+1);

        record_count1 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id1));
        record_count2 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id2));

        if (record_count1<>'') and (record_count2<>'') then
        begin
            SQLExecute('UPDATE component SET record_count='+record_count2+' WHERE id='+IntToStr(id1));
            SQLExecute('UPDATE component SET record_count='+record_count1+' WHERE id='+IntToStr(id2));
            frmLookups.tgLookupsComponents.dbUpdate;
            frmLookups.tgLookupsComponents.dbItemID := id1;
        end;

    end;
    ///When no record selected display info message
 procedure frmLookups_Button4_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin

    if frmLookups.tgLookupsComponents.dbItemID=-1 then
    begin
        ShowMessage('You should select a record');
        Exit;

    if (frmLookups.tgLookupsComponents.SelectedRow > 0) then
    begin
    //////////
end;

---------------------------------
edit:

Beside above, after applying filter for combo boxes, first one (components) worked but second combo (details) didn't


Attached updated sample project. It doesn't include the latest code for message pop-ups as I couldn't implement it correctly.

885

(20 replies, posted in General)

Sorry to bother you again on this Guys...


My assumption was once tGrid ordering done, they'd show on combobox dropdown in same order, but they are not.
In this case, I was using move up-down in lookups for relevant comboboxes on a different window i.e. Details.


Also, when no record on tGrid selected and user clicks on move up-down buttons, pop-up info message needed to inform users that they need to select a record first like in edit or delete buttons.


Any help on these please......

886

(20 replies, posted in General)

Hi ehwagner,


Thank you so much.........


Missing 'category' was a silly mistake on my part.

887

(20 replies, posted in General)

Hi Dmitry,


Thank you so much...........


------------------------------------------------
edit:


I made the change as advised and component tgrid move up-down worked fine. I applied the same code to Categories on lookups by changing button numbers and tgrid name but this time didn't work. Unless, I'm missing something else again, looks like something else needs changing.

888

(3 replies, posted in General)

Hi Dmitry,


Thank you very much for the fix..........

889

(20 replies, posted in General)

Hi Guys,


I was trying to apply Dmitry's code to move up and down part to a project. No errors but couldn't get them moving. Could somebody points out as to what's wrong with the following code please?


procedure Form1_Button3_OnAfterClick (Sender: string);
begin
    UpdateDatabase('component');
end;

procedure frmLookups_Button3_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin
    if (frmLookups.tgLookupsComponents.SelectedRow > 0) then
    begin
        id1 := frmLookups.tgLookupsComponents.dbItemID;
        id2 := frmLookups.tgLookupsComponents.dbIndexToID(frmLookups.tgLookupsComponents.SelectedRow-1);

        record_count1 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id1));
        record_count2 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id2));

        if (record_count1<>'') and (record_count2<>'') then
        begin
            SQLExecute('UPDATE component SET record_count='+record_count2+' WHERE id='+IntToStr(id1));
            SQLExecute('UPDATE component SET record_count='+record_count1+' WHERE id='+IntToStr(id2));
            frmLookups.tgLookupsComponents.dbUpdate;
            frmLookups.tgLookupsComponents.dbItemID := id1;
        end;

    end;
end;

procedure frmLookups_Button4_OnClick (Sender: string; var Cancel: boolean);
var
    id1, id2: integer;
    record_count1, record_count2: string;
begin
    if (frmLookups.tgLookupsComponents.dbItemID <> -1) and (frmLookups.tgLookupsComponents.SelectedRow < frmLookups.tgLookupsComponents.RowCount-1)  then
    begin
        id1 := frmLookups.tgLookupsComponents.dbItemID;
        id2 := frmLookups.tgLookupsComponents.dbIndexToID(frmLookups.tgLookupsComponents.SelectedRow+1);

        record_count1 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id1));
        record_count2 := SQLExecute('SELECT record_count FROM component WHERE id='+IntToStr(id2));

        if (record_count1<>'') and (record_count2<>'') then
        begin
            SQLExecute('UPDATE component SET record_count='+record_count2+' WHERE id='+IntToStr(id1));
            SQLExecute('UPDATE component SET record_count='+record_count1+' WHERE id='+IntToStr(id2));
            frmLookups.tgLookupsComponents.dbUpdate;
            frmLookups.tgLookupsComponents.dbItemID := id1;
        end;

    end;
end;

I have component component table with two field:
component, type text
record_count, type counter
and table grid named: tgLookupsComponents
checked button numbers and they are correct too.


---------------------------------------------
Edit:
Relevant part of the project attached

890

(3 replies, posted in General)

Hi Derek,

I used your hide panel script before and it worked fine but in this occasion I cannot get it working. Clicking on "Add" button just shows the panel briefly but it doesn't stay.


Could you be kind enough to show me what silly mistake I made on this one please?

891

(1 replies, posted in General)

Hi Dmitry,


I'm trying to create simple code/script repository application. I think it'll help me and perhaps others in the learning process. Please see the attached sample project.


All OK except 1 part which I could not do. I need "Original Script" and "Script Work" memo fields to display script with formatting, coloring and line numbering similar to MVD script tab page. Grouping and suggestion drop_down is not needed.


I hope I'm not asking too much.

892

(10 replies, posted in General)

Hi Guys,


I couldn't work out displaying  text with paragraphs plus line breaks on dialog windows.


procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
begin
    MessageDlg('Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10,mtInformation,mbOK,0);
end;

The above displayed like this on dialog window:
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


I wanted add paragraph plus line break (space) like this:
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset
Unfortunatly, there is no known URL for this asset


Please ignore double spacing, I meant single line break.


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


edit:


It seems adding
''+#13#10+
where line space required doing the job. However, I have no idea currently what #13#10 stands for tho.


procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
begin
    MessageDlg('Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    ''+#13#10+ //Line space
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    ''+#13#10+ //Line space
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10+
    'Unfortunatly, there is no known URL for this asset.'+#13#10,mtInformation,mbOK,0);
end;

893

(1 replies, posted in General)

Hi Guys,


I was trying to implement vacuum database button in a test project, inspired from Mathias' code. I have done something it seems working but not sure if its done correctly. This one aims to vacuums all database on click. For vacuuming individual table please see Mathias post here.
http://myvisualdatabase.com/forum/viewtopic.php?id=2089


Starting blank db size was 4k
Added large text  of 1.2MB (full text of Moby Dick) and MVD db file gone up to 2MB
Then I added 10 .jpg images (size in total 2.6MB) db file size gone up to 4MB
So in total I added about 3.8 MB worth data then deleted the records. After vacuum db size gone back to 4k

Just wandering if this implementation is correct and safe?


---------------------------------------------
edit:


I think I sorted out on click warning message thing, thanks to Mathias script. I have deleted previous incomplete sample project and attached what I think complete one... Still needs to be checked though if I did it correctly before applying to actual projects.

894

(20 replies, posted in General)

Thanks a lot ehwagner.............

Great stuff.. that completes the task fully.

895

(20 replies, posted in General)

Hi Dmitry,


Thank you VERY much.....................................


That's exactly what wanted to do.

896

(20 replies, posted in General)

Hi Derek,


Thanks for the sample...


The following image may explain better as to what I like to do:


http://s18.postimg.org/c09ylbqnt/tgridrm.png

Its more like third part of search action dialog rather than save action (I mentioned in my first post) of MVD


As said on first post multi select (CTRL+LeftClick, SHIFT+LeftClick, CTRL+A) is desirable before move.


Perhaps Dmitry's help needed on this one.

897

(20 replies, posted in General)

Hi Guys,


I like to move records from one tGrid to another and then move them up-down after move on moved tGrid, similar to MVD save action dialog. Having multi select when moving one tGrid to another would be nice.


In Use tGrid records would be used with relevant comboboxses


Please see the attached sample project.

Excellent work Mathias.


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


Now I have much better understanding of dealing with menus and menu items.

Nice one Mathias. Thanks a lot for sharing...........


What about using PNG Alpha instead of bitmaps?


Also top and bottom margins of the image would be useful. Does button resizes according to image size or restricted to only 16x16 px?

900

(12 replies, posted in General)

Hi ehwagner.


Thanks a lot for the latest sample project.....


I was trying to apply math to live situations in terms of business but my logic may be totally flawed.


Agreed, " starting balance is a starting balance regardless if it is negative or positive" as long as it's not zero (in terms of business logic). One can start a business with with negative (borrowed money) or positive balance. If started with negative balance of 100.00 and on the way borrowed further 50.00 as cash-flow starting to get thin (where ending balance -50.00) then liability becomes -150.00.  Minus figures needs to be added and showed as minus figure. As I said my approach may be wrong, there may be better way of dealing with such situations.


Once again, thank you for your kind help and patience.