Hi,
Perhaps try it something like this (see attached).
In the example, I've added a new field ('roletohide') to the _user table to hold the role that needs to be hidden rather than hard coding it in the script.
It's a bit 'basic' (I'm busy with grandchildren and Christmas for my sins and haven't much free time at the moment) but hopefully it gives you some ideas.
The passwords for all users is 'password' apart from Admin which is 'admin'.
Regards,
Derek.
101 2023-12-20 02:13:29
Re: Hide a row or a specific record in frmdbCoreUserForm (17 replies, posted in Script)
102 2023-12-19 00:30:32
Re: Hide a row or a specific record in frmdbCoreUserForm (17 replies, posted in Script)
Hi,
The name of the grid is 'frmdbcoreusers.gridusers'
However, I can't find any reference to the name of the 'role' combobox on 'frmdbcoreuserform'. I wrote a small program a while back to identify all the elements on the 'frmdbcore' suite of forms and the one element that it never found was the 'role' combobox which is puzzling.
Derek.
103 2023-12-14 20:27:20
Re: How to print the Current login Username on Report ? (2 replies, posted in General)
Hi FMR,
It's not strictly the correct way to do it ( ) but if you just want something that is quick and easy then have a look at the attachment.
Just add an empty field to your lead table and add the user name immediately prior to running your report. Then when you close the report, remove the user name.
Valid sigin-in details are admin / admin, FMR / password, Derek / password;
Derek.
104 2023-12-11 17:03:26
Re: [SOLVED] Need help again. Problem with grouping (13 replies, posted in Reports)
Hi Step-In,
Probably a few ways to do it.
Attached is one suggestion using a calculated field; I've used a second tablegrid to load the consolidated (one line per driver) data before running the report rather than hijack tablegrid1 (I didn't want to mess up your layouts etc).
Select a driver using the existing combobox (combobox2) or leave the combobox blank to see all drivers.
You'll probably want to alter the layout of the concatenated field and also the report so I didn't spend any time on them - it's more just to give an idea how you could approach it.
Regards,
Derek.
105 2023-12-06 11:22:47
Re: transfer from tablegrid (3 replies, posted in General)
Hi,
if form1.tablegrid1.cell[0,vi].asboolean = true (asboolean) and also the form1.tablegrid1.cell[1,vi].asstring (asstring).
Basically, when you query the contents of an individual cell in a tablegrid, you need to specify 3 things
1. which column the cell is located in (in your example, this is column 0)
2. which row the cell is located in (in your example, this is the variable 'vi').
3. what data type the cell contents contains (boolean, integer, datetime etc etc). All cells are presented as strings in the tablegrid so, because a checkbox is a 'boolean' field, you need to specify '.asboolean' in your script if you want to perform some action on it.
Have a look at the amended example; tick a couple of the checkboxes in the tablegrid and then click the 'all the checked' button and you can see the different data types being displayed in the 'message box' as you move through the tablegrid.
There are (as always with MVD) other ways of copying cells from the tablegrid to an edit or memo field that don't involve using the 'checkbox' - it all depends on what you are doing and how you want your application to flow.
I hope this makes things clearer.
Derek.
106 2023-12-05 20:35:41
Re: transfer from tablegrid (3 replies, posted in General)
Hi,
Try it like this (see attached).
I'm guessing that there are probably two ways you might want to see the selected rows in the memo fields (one per line or comma delimited) so both options are in the script.
Regards,
Derek.
107 2023-12-02 01:13:29
Re: need help with import (2 replies, posted in General)
Hi,
Have a look at the attached example which loads data from an external .csv, shows what rows have been matched and which have not been found and then updates those rows that match.
Maybe this can give you some ideas.
Derek.
108 2023-12-01 20:54:03
Re: add and remove qty (Any help!!!) (10 replies, posted in General)
Hi,
I thought that the example I sent earlier already did this.
When you have loaded your .csv file, you can click on the 'view import' button and any parts that do not exist are highlighted with a 'not found' warning.
You can simply place a button on the 'frmviewimport' form to create a new record if required.
Derek.
109 2023-12-01 10:23:50
Re: add and remove qty (Any help!!!) (10 replies, posted in General)
Hi,
I didn't realise that the part number could appear multiple times in your input file.
But it's a easy fix - just change the script to 'select sum(adjustment)' from .... etc etc.
Please see the amended attachment.
Derek.
110 2023-11-29 15:49:21
Re: add and remove qty (Any help!!!) (10 replies, posted in General)
Hi,
Perhaps you could try it something like this (see attached).
On Form1, you can
1. manually adjust quantities by selecting a part number from the combobox, typing in an adjustment amount and the qty is updated.
2. update adjustments in batch by uploading a CSV file. Specifically,
2.1 click on the 'import' button to load the CSV into the 'csvimport' table.
2.2 click on the 'view import' button to review what is going to be updated - it will also show any data mismatches.
2.3 click on the '⇈' button to update the quantities in the 'tameio' table.
Maybe this gives you some ideas.
If anything is not clear, just shout.
Regards,
Derek.
111 2023-11-28 15:53:23
Re: Создается пустая строчка во вложенных таблицах (14 replies, posted in Russian)
Если вы не хотите писать сценарий, попробуйте использовать фильтр в своем отчете.
Это работает независимо от того, выделена ли запись в сетке таблицы или нет.
В прилагаемом примере
1. оставьте фильтр (kpadd,combobox1) пустым, чтобы отобразить все записи в отчете.
2. выберите значение фильтра, чтобы отображать только те записи, которые соответствуют.
Если вы хотите только отображать все записи и вам не требуется фильтрация, просто скройте фильтр.
Derek.
112 2023-11-27 19:27:54
Re: add and remove qty (Any help!!!) (10 replies, posted in General)
Hi,
I'm not entirely sure what you are wanting to do.
Perhaps you can give us some more details (ideally with an example of what should happen).
Also, I don't understand how you want Excel to work with your program.
Regards,
Derek.
113 2023-11-27 12:18:18
Re: Подскажите как открыть окно СМЕНЫ ПАРОЛЯ (2 replies, posted in Russian)
Hi,
Try it like this.
Derek.
114 2023-11-27 11:34:35
Re: Создается пустая строчка во вложенных таблицах (14 replies, posted in Russian)
Привет Godless, Vladimir,
Если я правильно понял вопрос, чтобы удалить пустые строки в таблицах, вы можете создать два статических фильтра (по одному для каждой таблицы).
Смотрите скриншот во вложении.
С уважением,
Derek.
.
If I understood the question correctly, to remove empty rows in the tablegrids, you can create two static filters (one for each tablegrid).
115 2023-11-21 00:22:45
Re: avoid the same input if it exist in table ? (30 replies, posted in Script)
Hi T,
I guess we all have our own slightly different ways of testing for duplicates.
Attached is another option (as always, I like to keep things simple and my script as small as possible).
Its down-side (albeit not a major one) is that it introduces an element of data redundancy by storing a concatenation of the particular fields that you want to perform a duplicate check against.
Anyway, maybe it can give you some ideas.
Regards,
Derek.
116 2023-11-17 20:34:02
Re: Progressbar Color (13 replies, posted in General)
Hi StateOne,
Another slightly different approach is to use overlaid labels.
The attachment is based on elapsed time but it could just as easily be applied to any scenario such as your 'diesel tanks' example.
Maybe this gives you some more ideas.
Regards,
Derek.
117 2023-11-13 16:32:08
Re: Data deletion message (4 replies, posted in General)
Hi,
If you want full control, you'd be better off writing your own 'deletion' pop-up (for example, use a panel with your own message, your own buttons etc) - see attached.
Derek.
118 2023-11-13 15:43:11
Re: how to speed up Combo box population linked to a parent combo box. (5 replies, posted in General)
Hello All,
There is also an option to make the combobox non-searchable (no need for a script - see the attachment (and the screen capture in the attachment)).
This fixes the problem of the combobox taking a long time to retrieve the relevant data - however, although you can still SORT the combobox, you lose the functionality of being able to SEARCH the combobox and this may be too much of a compromise.
Acknowledgement to Sparrow for the test program and data.
Derek.
119 2023-11-13 01:22:26
Re: Data deletion message (4 replies, posted in General)
Hi,
Try it like this (see attached).
Or you can simply use
begin
translate('Are_you_sure_you_want_to_delete_the_record','Delete Me?');
end.
However, the text associated with buttons such as 'yes', 'no', 'ok' etc are Windows generated and should appear as per your PC's language settings; they cannot, as I understand it, be changed directly in MVD.
Derek.
120 2023-11-10 13:06:41
Re: Search using EditCounter (11 replies, posted in General)
Hi,
I guess it's the difference between 'search' and 'filter' (without getting weighed down in semantics ).
When I use an editcounter (which doesn't allow 'fuzzy' searching), I'm not actually using it to search for a record that I can't find - I already know the number - I'm using it to filter out all the other rows in the tablegrid that I don't want and go directly to the record rather than always scrolling up and down; in a tablegrid with a large number of rows, it's probably the fastest way of doing it.
Typically, I use an editcounter to auto-generated invoice or order numbers.
Of course, you can always copy an editcounter into a calculated field which would allow 'fuzzy' searching if that's more applicable; as always, it depends on the actual requirement.
Derek.
121 2023-11-08 18:19:00
Re: Как отобразить в Label выбранную строку(запись) из TableGrid (4 replies, posted in Russian)
Привет,
Попробуй это.
Derek.
122 2023-11-08 17:49:29
Re: Как отобразить в Label выбранную строку(запись) из TableGrid (4 replies, posted in Russian)
Привет,
Попробуйте так (хотя есть и другие способы).
Если вы используете общую процедуру (в примере она называется «buildlabel»), это означает, что одна и та же процедура запускается, если вы щелкаете по сетке с помощью мыши, если вы используете клавиатуру для прокрутки, а также когда вы закрываете Form2.
С уважением,
Derek.
123 2023-11-07 21:32:34
Re: Search using EditCounter (11 replies, posted in General)
Hi,
Works okay for me (see the attachment).
Derek.
124 2023-11-07 12:34:05
Re: Self table reference AKA self referencing relationship (8 replies, posted in General)
Hi Thierry, Konstantin,
The field that stores a link to the table should be called id_<table name>
Manually adding a field to the table and calling it 'id_[tablename]' to force a relationship back to itself is very neat - and so simple (but then, everything is simple once someone first thinks of it and shows you how!).
I've added this to my list of useful tricks.
Thanks,
Derek.
125 2023-11-07 12:27:46
Re: Search using EditCounter (11 replies, posted in General)
I often do that too!
With regard to using an 'editcounter' as a filter, although it is possible, I often find it better to copy it to an edit field anyway so you can use the 'fuzzy' search (%s%) and "incremental search" options (neither of which are possible if you use the "editcounter" directly as a filter).
Regards,
Derek.