Hello Rufmersamlabag, Hello Dmitry,
Attached is an old project of mine that I have made a quick couple of changes to.
Would this be of any help to you?
Regards,
Derek.
1,951 2018-08-09 12:55:35
Re: Bulk input attendance system on grid table with add date feature (2 replies, posted in General)
1,952 2018-08-08 08:23:13
Re: exe file run (7 replies, posted in General)
Hi There,
In a script, you could use something like this:
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
openfile('C:\Documents and Settings\user\Desktop\blackpearl\red\red.exe'); //*** calls another MVD program (called red.exe)
end;
procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
begin
openfile('notepad.exe'); //*** calls notepad.exe (no file specified)
end;
procedure Form1_Button3_OnClick (Sender: TObject; var Cancel: boolean);
begin
openurl('www.myvisualdatabase.com'); //*** calls the specified website using your default browser
end;
begin
end.
Regards,
Derek.
1,953 2018-08-07 14:25:24
Re: On Grid Table Click show photo error (10 replies, posted in General)
Hi Nitin, Dmitry,
Just for information, I have tried it all the way back to Version 3.5 and I still don't get any error message either.
Derek.
1,954 2018-07-29 17:52:33
Re: Action trigger upon certain date (4 replies, posted in Script)
Hi Alex,
Have a look at the attached which does most of the things you mentioned (well, it should but I've not really tested it!).
There are 2 basic ways of approaching it - using a single table (which I've done because it was quicker) or using a second, related table which would hold details for each cycle of depreciation for each asset - it's probably the way to go if I were doing it 'for real'.
Each asset is set up with a purchase date, purchase price, depreciation rate and number of days between depreciation cycles. After that, the main grid shows in red assets that are due to be depreciated and, when you select one, the 'depreciate' button is visible. Click it and it automatically calculates the depreciation and deducts it from the asset book value. It also calculates when the following depreciation date is due.
Once depreciation starts, I 'lock' some of the asset details (ie price, rate, date etc) otherwise it would invalidate depreciation that has already occurred.
Anyway, I'm sure you'll get the picture and hope you can use some of it in whatever project you have in mind.
Regards,
Derek.
1,955 2018-07-29 10:29:54
Re: Ask for help with calculations. (1 replies, posted in FAQ)
Hi,
I think the syntax for your calculated field should be
(
select sum(qty) from ininfo where prdinfo.id = ininfo.id_prdinfo)
)
Also, you don't need id_ininfo in the prdinfo table (I imagine it's just a one-way relationship).
Regards,
Derek.
1,956 2018-07-29 01:02:16
Re: Action trigger upon certain date (4 replies, posted in Script)
Hi,
Please see attached (using your example, there are some assets and when they are more than 365 days old, the option to enter disposal details becomes available). I've hard coded it for 365 days but it's just as easy to make that dependent on the record itself (in your example, some assets might be disposed of after 1 years, some after 3 etc etc).
Obviously, it doesn't have to be a button that's enabled - it can be ANY object that can be placed on a form or, indeed, ANY property of that object (the one that is probably used more than any other is setting a cell's colour in a tablegrid depending on elapsed date, value threshold etc).
Regards,
Derek.
1,957 2018-07-28 17:32:05
Re: Поиск по диапазону времени. (1 replies, posted in Russian)
Hello Metatron,
Надеюсь, я понял ваш вопрос (я использую переводчик Google!).
Пожалуйста, взгляните на приложение, которое делает некоторые из вещей, о которых вы спрашиваете, - оно основано на моем старом проекте. Я использовал даты начала и окончания, а также создал таблицу для «сдвигов». Кажется, лучший способ проверить все возможности.
Надеюсь, это поможет,
Regards,
Derek.
1,958 2018-07-25 19:37:57
Re: Как получить предыдущее значение комбобокса (2 replies, posted in Russian)
Привет, Михаил,
Возможно, попробуйте это так.
Надеюсь это поможет,
Derek.
1,959 2018-07-23 17:22:51
Re: Как зафиксировать левый столбец в TableGrid? (2 replies, posted in Russian)
Здравствуйте,
Установите свойство fixedcols таблицы tablegrid на «1» (или «2» и т. Д.).
См. Прилагаемый скриншот.
Derek.
1,960 2018-07-20 16:18:03
Re: Групповой Enable/Disable для полей ввода (3 replies, posted in Russian)
Hello Mikhail,
Посмотрите пример и на скриншот (mikhail panel.jpg).
Если вы поместите все свои поля на панель, вам нужно только включить / отключить панель.
Я использовал другой цвет для панели, чтобы вы могли ее легко увидеть, но обычно это тот же цвет, что и фон формы (чтобы сделать его невидимым).
Надеюсь, это имеет смысл (с помощью Google Translator).
Regards,
Derek.
1,961 2018-07-20 10:53:10
Re: Кнопка копирование (31 replies, posted in Russian)
Hello Scopus,
Возможно, попробуйте это так
Form1.GridEmployees.dbitemid := last_insert_id; // select new record in TableGrid
Regards,
Derek.
1,962 2018-07-18 09:50:26
Re: TableGrid Field Conditional Coloured Text (4 replies, posted in General)
You're welcome.
Just a thought, but if you want to colour code the text rather than the background, you might want to switch bold on as well, otherwise it can look a bit washed-out!
If you do, add to the script - form1.tablegrid1.cell[1,vi].fontstyle := fsbold;
Regards,
Derek.
1,963 2018-07-17 11:15:22
Re: TableGrid Field Conditional Coloured Text (4 replies, posted in General)
Hi David,
How's things in your corner of the world?
Have a look at the attached as a way of colour coding according to elapsed days (I've only done it for 3 days worth but you'll get the general idea).
If it's the actual text you want colouring rather than the cell background, simply replace .color with .textcolor in the script.
Hope this helps,
Regards,
Derek.
1,964 2018-07-11 09:47:26
Re: Редактирование/удаление если TableGrid получен из SQL-запроса (5 replies, posted in Russian)
Hello Mikhail,
Я не считаю, что это важно, где находится идентификатор.
См. Прилагаемый пример.
С Уважением,
Derek.
1,965 2018-07-10 16:47:07
Re: Редактирование/удаление если TableGrid получен из SQL-запроса (5 replies, posted in Russian)
Здравствуйте Mikhail,
В конце инструкции select sqlquery вы должны включить идентификатор записи.
Например:
select
person.firstname,
person.lastname,
person.id
from person
where.......
Возможно, это проблема.
Regards,
Derek.
1,966 2018-07-05 10:07:52
Re: Проблема с TableGrid после поиска (6 replies, posted in Russian)
Hello,
Вы можете использовать тот же tablegrid.
Чтобы сбросить таблицу после поиска, просто снимите критерии поиска.
Посмотрите прилагаемый пример.
Regards,
Derek.
1,967 2018-07-02 20:26:04
Re: Image replace by script (5 replies, posted in Script)
Hi There,
A couple of things to point out, if you don't mind;
1. I think it would be better to display a picture based on a value from a combobox rather than from an edit field (if the user types in something incorrectly, for example, the picture won't show).
2. perhaps not too relevant in your example, but hard coding it into the script means that if a new option is used (for example, a bakery) then this won't get selected unless the developer adds it into the script).
Attached is a small example of how I might approach it which 'future-proofs' you against any additions/changes to shop type; hopefully it can give you some ideas.
Regards,
Derek.
1,968 2018-06-29 20:39:00
Re: ComboBox открыть сразу, как будто на него нажали (2 replies, posted in Russian)
Hello
Возможно, вы можете сделать это так?
Derek.
1,969 2018-06-28 16:42:49
Re: Сортировка слайдов в TableGrid вручную (10 replies, posted in Russian)
Datagrid может отображать данные из одной таблицы или из многих связанных таблиц; это не имеет значения, потому что моя сохраненная последовательность сортировки использует номер автоинкремента самого datagrid - он не зависит от каких-либо таблиц.
В этом примере я оставил 2 столбца видимыми, чтобы вы могли видеть, что происходит. При первом запуске программы столбец «old sort order» и столбец «new sort order» всегда будут одинаковыми. Когда вы впоследствии меняете порядок сортировки, столбец «new sort order» никогда не изменяется, и это порядок сортировки, чем он сохраняется при закрытии программы.
И убедитесь, что последовательность сортировки, указанная в свойствах объекта datagrid, установлена в столбец «new sort order», иначе он не будет работать
Извините, если это неясно - с помощью переводчика Google.
Дерек
1,970 2018-06-28 08:52:02
Re: Сортировка слайдов в TableGrid вручную (10 replies, posted in Russian)
Здравствуй,
Возможно, вы могли бы попробовать это так.
С уважением,
Derek.
1,971 2018-06-26 22:45:10
Re: I need help with this please!!! URGENT! (4 replies, posted in Script)
Hi Alex,
This probably isn't 100% what you're looking for but I guess you can take the script and tweak it to do more closely what you want. At least it might give you some more ideas of how to approach the problem.
It's a bit rough and ready as I'm rushing - so there's not much by way of test data in it and I've not checked that every thing works exactly as it should.
Hope this helps,
Derek.
1,972 2018-06-26 12:57:23
Re: I need help with this please!!! URGENT! (4 replies, posted in Script)
Hi There,
I'm not sure I understand the requirement properly.
For each respondent, you need to know
1. respondent identifier (presumably anonymous - (counter?)
2. Question 1 - what state they reside in (combobox with a list of states)
3. Question 2 - what sex they are (combobox with a choice of genders)
But Queston 3 is where I start to get confused;
If marijuana, alcohol, crack and ecstasy are checkboxes, they can only contain responses of 'yes' or 'no'. So where does your combobox with values of 'yes', 'no' and 'maybe' fit in? Perhaps you could explain Question 3 in a bit more detail?
Thanks,
Derek.
1,973 2018-06-24 23:22:29
Topic: Treeview - sorting (1 replies, posted in General)
Hi Everyone,
I had to write an app recently using treeview functionality and the user wanted to be able to re-sort the tree so I knocked up a script to do this (it's pretty basic but it seems to work!).
Maybe it can help some of you who have asked about this topic in the Forum.
I can't say for certain if it works for every scenario and my app only uses one table but I imagine the general principle should still be valid.
If it's of any use to anyone, please feel free to copy it, change it, improve on it etc.
I've left a bit of test data in it which means it's too large for here but it can be downloaded from this link
https://app.box.com/s/xozrjtjku8z21grc0x0n8433vidzbbxl
Regards,
Derek.
1,974 2018-06-22 09:28:18
Re: Formatting a calculated field (4 replies, posted in Script)
Hi Kees,
Attached is the way that I've always formatted columns (and footers and headers). I'm sure it's not the only way but it's always worked for me (so it's what I stick with!).
A couple of things to mention;
1. in the tablegrid, columns start at 0 rather than 1 so vergoeding is actually column3 in your example.
2. you hadn't actually associated the tablegrid1 'onchange' event with the code in the script.
And apologies but I don't have a 'euro' symbol on my keyboard so you'll have to make do with £ - LOL! (just replace £ in the tablegrid properties( footer settings) and in the script).
Anything not clear, then just drop a message.
Regards,
Derek.
1,975 2018-06-14 11:53:23
Re: [Решено] Замена вывода значения в колонке грида (2 replies, posted in Russian)
Здравствуйте,
Думаю, я бы использовал рассчитанное поле. Вот пример.
Надеюсь, это поможет.
С Уважением,
Derek