2,526

(2 replies, posted in Script)

Hi Dmitry,
It works perfectly now.
Thanks as always for your help.
Derek.

2,527

(2 replies, posted in Script)

Hello Dmitry, MVD Team,

When you click 'new record' on a tablegrid, create a new record and click 'save', is it possible to automatically highlight the new row that has just been created when you return to the tablegrid?  At the moment, the highlight always stays on whatever row had been selected before the new record was created.

I have been trying to write something like form1.tablegrid1.selectedrow := last_insert_id('tablename')  but maybe this isn't the correct way to do it.

Thanks,  Derek.

2,528

(7 replies, posted in General)

Hello Dmitry, Mathmathou,
Although i am still on Version 1.45, i have nevertheless managed to get all the totals on my 3 grids working correctly now (i hope!!).
Thank you both for your advice and interest.
Derek.

2,529

(7 replies, posted in General)

Hello Mathmathou,
Thanks for taking the time to look through the script - messy, isn't it!!
As soon as i upgrade to 1.50, this problem (and probably some others too) will resolve themselves.
Derek.

2,530

(7 replies, posted in General)

Hi Dmitry,
Yes, it sums the totvalords.column.footer correctly in Version 1.50.
I was going to try that but what was puzzling me was why it was able to sum totnumords.column.footer but not totvalords.column.footer - both fields are defined as calculations so i was expecting it to work for both columns or not at all.
Thanks for the quick response.
Derek.

2,531

(7 replies, posted in General)

Good Morning Dmitry and MVD Team,
I have set a tablegrid column footer to sum a column (suppliers.totvalords which is defined as a 'calculated' field type). 
But if the cell value of suppliers.totvalords is blank, the column footer total also shows as blank (see screenshot dmitry - no totals 1.jpg). 
To try and correct this, I then formatted the column on the tablegrid to display as 0 but the column footer total still shows blank (see screenshot dmitry -no totals 2.jpg).
If I delete the row that contains the suppliers.totvalords blank cell, the column footer total sums correctly.
Is there a way to fix this?
Thankyou,
Derek

2,532

(4 replies, posted in Script)

Hello Prahousefamily,

The way i autoload the value from the datagrid to the combobox is by a small script.

procedure form6_OnShow (Sender: string; Action: string);
begin
if Action = 'NewRecord' then  form6.ComboBox1.dbItemID := Form1.tablegrid1.dbItemID;
end;

Hope this helps.
Derek.

2,533

(1 replies, posted in Script)

Hello Again Dmitry,

I have a script to force numeric entry.

procedure form6_Edit1_OnKeyPress (Sender: string; var Key: Char);
  begin
    if not (Key in ['0'..'9']) then Key:=#0;
  end;

This works as it should and only allows 0-9. 
However, if you make a mistake entering data (for example, enter '1234' instead of '5678'), it is not possible to use the 'backspace' key;  instead, you must use the 'left arrow' key to move the cursor to where the mistake is and then use the 'delete' key.
Is there a fix for this?

Thanks,
Derek.

2,534

(4 replies, posted in General)

Hi Dmitry,
It is very useful  to call web sites directly from within My Visual Database.
But many of the sites i use are https:// and, as far as i can see, calls from within My Visual Database only works with http://.
Is there another way of doing this?
Thanks,
Derek.

2,535

(4 replies, posted in Script)

Hi Dmitry,
Thank you again for your help;  it works perfectly now.
Derek.

2,536

(4 replies, posted in Script)

Good Afternoon, Dmitry,
I have a form with a tablegrid (tablegrid1),  a sub-tablegrid (tablegrid2) and a memo field.
I use a script to automatically highlight the first row of tablegrid1 but this does not automatically retrieve the related rows for tablegrid2 (screenshot1).  The related rows for tablegrid2 are only displayed once the User has clicked inside tablegrid1.
Is it possible to retrieve the related rows for tablegrid2 as soon as the first row of the tablegrid1 is highlighted by the script  so that the form displays like this (screenshot2) and the User does not have to click inside tablegrid1?
I have enclosed a zip file of my project so you can see the problem.
Thankyou,
Derek

2,537

(3 replies, posted in General)

Hi Rob,

I had a similar issue but am using 1.45 so i don't have the option of a currency field type. 
If it helps, here's the relevant part of the script that i ended up with.

var
    i,c: integer; s_amount,s_famount,s_fpa: string; Cancel: boolean;
// format columns for £, thousand seperator and 2 dps
c := form1.grid1.RowCount - 1;
    for i := 0 to c do
    begin
        s_amount := form1.grid1.Cells[10,i];
        if ValidFloat(s_amount) then
                form1.grid1.Cells[10,i] := '£'+FormatFloat('#,###,###,##0.#0', StrToFloat(s_amount) );
    end;

// format column footers for £, thousand seperator and 2dps
    for i := 0 to c do
    begin
        s_famount := form1.grid1.Columns[10].Footer.Caption;
        if ValidFloat(s_famount) then
                form1.grid1.Columns[10].Footer.Caption := '£'+FormatFloat('#,###,###,##0.#0', StrToFloat(s_famount) );
    end;

I'm sure it's not pretty but, hey, it works for me!
Derek.

2,538

(2 replies, posted in Script)

Dmitry. 
It's working exactly how i want it to now.  I've also added cell colour highlighting so the exceptions are very easy to see.
Thanks as always for your help and your quick response.
Derek.

2,539

(2 replies, posted in Script)

Good Afternoon Dmitry,

I have a field (DOCUMENT_FLAG) defined as boolean;  it's purpose is to show if there are any missing documents for a selected record. 
At the moment, in the tablegrid the values in the DOCUMENT_FLAG column show as either 'Yes' or 'No' but I would like it to show as either 'Yes' or ' ' (blank)  because it is then much easier to see the exceptions.
All of the combinations I have tried in my script come back with errors such as 'incompatible' TCell', 'String'.  What is the correct syntax? 
Thanks,

Derek.

2,540

(4 replies, posted in General)

Hi Rob,
Thanks for your suggestion - yes, it was an outdated version i was using. 
And thanks for the pointer to the scroll bars script.  I had had a quick look around in case it had already been addressed but must have missed it (it was very late, in my defence!).
Derek

2,541

(4 replies, posted in General)

Hello Dmitry,
As you said, the problem is fixed when using the latest version of the software.
I have written a script to let the user use both mouse and arrow(up) and arrow(down) in the tablegrid and have the memo text display automatically instead of having to double-click.  But in adding this script, it has also fixed the original problem of not making a visible window modal in Version 1.45.  Very unexpected!
Thanks as always for your help.
Derek.

2,542

(4 replies, posted in General)

Hi Dmitry,
I have a simple application (1 table, 2 fields) with a tablegrid and a form to show the record together on the same form.
I can successfully view all records in the tablegrid and add, edit and delete records but every time I do this, i get an error message "Cannot make a visible window modal".  However, I am able to click past the error message and then continue.
Is there some way of getting round this?
The effect that I was trying to achieve was to be able to see each form record as I scrolled down through the tablegrid.
I have attached the project so you can see the problem for yourself.
Also, is there a way of attaching scroll-bars to a memo field?
Thanks,
Derek.

2,543

(6 replies, posted in General)

Hi Dmitry,
My tablegrids are now fully formatted exactly as I wanted.
1. Numeric columns (and footer totals) are right-hand justified
2. Footer totals display in a different colour
3. Numeric columns (and footer totals) have a ',' thousand separator
4. Currency columns (and footer totals) display a '£' sign and round to 2 decimal places
5. Numeric column headers are right-hand aligned
6. Conditional formatting (colour highlighting) is working on individual cells.
Thanks again for your advice and the quick responses.
Derek.

2,544

(6 replies, posted in General)

Hi,

I have a calculated field that contains currency values that i need to display in a tablegrid column in a specific format.
Example:
     VALUE                          VALUE
   £324.35             not    324.35341
£4,356.67             not  4356.66845

Can you tell me the best way to
a) format the column with a '£' currency sign
b) format the column using a ',' as a thousands separator
c) format the column to 2 decimal places.

Thanks,
Derek.

2,545

(5 replies, posted in General)

Hi Dmitry,
Tablegrid columns and tablegrid footers and now both aligned to the right - perfect!
Thanks again.
Derek.

2,546

(5 replies, posted in General)

Hello Dmitry,

1. The script  to prevent all rows showing in the tablegrid when no search criteria entered works very well.

2. The multi-line editor for Caption of component label is great - very easy now to add help messages and instructions.  I hope other users will find it useful too.

3. Numeric columns in the tablegrid are now aligned to the right - excellent.  Is there a way of aligning the tablegrid totals at the bottom of the columns as well?  That would be even better but if it's a big change, it's not so important - my project is already much better than before.

Thanks for your help and the very quick response.

Derek.

2,547

(5 replies, posted in General)

Hi,

I am new to MVD and just trying it out but i am really impressed so far.  I have 3 questions and apologies if they've been answered elsewhere (i have gone through the forum topics and couldn't find anything similar).

1.  I have a tablegrid (set to 'no auto execution of the query' so that it initially displays zero rows), a search criteria and a search button.  However, the user can simply press the search button without entering any search criteria to retrieve all the data table rows which is not what i want.  I am trying to force the user to enter something in the search criteria, retrieve only the relevant sub-set of data rows and then when the selection criteria are cleared, the tablegrid should again display zero rows. 
I have tried using 'incremental search' which works for the first time but when the search criteria is cleared, the tablegrid again shows all rows.  I have also tried using a filter on the field i am searching on and a filter in the tablegrid but neither works.  Is there something i am not doing correctly?

2.  I have an area of one screen where i have written some brief Help notes for the user.  However, i have only been able to achieve this by using multiple text labels!  Although it looks ok, it is difficult to maintain.  Is there a better way to achieve this?

3.  Is it possible to align numeric fields to the right in a tablegrid?

I have attached project details in case this makes it easier to understand what i'm trying to achieve.

Sorry for writing in english but i only know a few words of russian!  Thanks in anticipation and congratulations on a great piece of software.
Derek.