2,151

(3 replies, posted in General)

Hi Dmitry,
Thanks for the reply,
Can't 'namecase' be added as a dropdown value for the 'charcase' object property for edit fields?
That would be one less thing that requires scripting.
Derek.

2,152

(3 replies, posted in General)

Hi Dmitry,
I use the 'namecase' function to capitalise the first letter of names automatically.
If I associate it with an 'on exit' event, it works.  However, users may just hit 'enter' to save rather than exiting the field first in which case the script does not execute.
So I have tried associating 'namecase' with an 'on change' event.  Yes, it works........BUT the value entered then goes from right to left instead of left to right (please see attached).
Is this something you can fix?
Thanks,
Derek.

2,153

(13 replies, posted in General)

Morning David,
Most of the time, I just use the 'search' button at the top of this forum page, type in something like "justify" or "align" or "alignment" and see what comes up.  It can be a bit hit and miss but in a strange way, that can help as well as you sometimes come across other things that you didn't realise you could do (I know, I need to get out more!).
Another way might be to look at the object properties.  I know in your 'tablegrid column justify' question it doesn't directly help, but there is an object property for edit fields called 'alignment' with values of 'taleftjustify, 'tacenter' and 'tarightjustify'.  So I'd probably then knock up a line of script and just see if it also worked with columns.  Occasionally, you strike lucky.
Derek.

2,154

(1 replies, posted in General)

Hello Dmitry,
There is already a 'transparent' object property for labels.
Is it possible to have a 'transparent' object property for other objects as well?
The effect I am trying to get is a transparent tablegrid with a watermark background image (please see attached screenshot).
Thanks,
Derek.

2,155

(13 replies, posted in General)

Morning David,
Please see attached for a couple of worked examples.
To right justify tablegrids for numeric columns, you only need to align the header (the column values and the footer take their alignment from the field definition (in this example, currency)).
To left justify tablegrids for numeric columns, you need to align both the column values and the footer.
.
Morning Dmitry,
Can the column header alignment be automatically set to right justify - the same as the column values and the footer for integer, currency and real fields, so that it doesn't have to be done by script?
.
Regards,
Derek.

2,156

(5 replies, posted in General)

Hi Dmitry,
This is great - it does exactly what I want it to do now - I think this is going to be very useful in a lot of other applications.
Many thanks for your help.
.
Hi EHW,
Thanks for your interest and the alternative suggestion - I've not seen this sort of 'hot spot' clicking (for want of a better description) used in MVD before.  I think this, together with Dmitry's response using 'Get RowAtPos' is going to create new and interesting ways of designing tablegrid interactions for me.
.
Derek.

2,157

(5 replies, posted in General)

Hi Dmitry,
I am trying to achieve the following in a small application.
1.  The user clicks and holds down the mouse button.  This executes an sql call and puts the result into a memo field which is then made visible and pops up on screen.
2.  When the user releases the mouse button, the memo field is cleared and hidden.
3.  I am doing this with 'on mouse down' and 'on mouse up' events.
It works well as a concept and is quick and easy for the user.
However, when you perform this on a different row in the tablegrid, the information in the memo field is for the previously selected record - so you have to first click on the row you are interested in to give that row focus AND THEN click and hold down the mouse - TWO separate actions.
Is there anyway by script that you can perform this as ONE action - click and hold down the mouse button and the row is given focus AND the sql call is executed?
I hope I've explained this clearly.
Thanks,
Derek.

2,158

(3 replies, posted in General)

Hi,
This usually happens if you do not close the current form after saving;  closing the form is the easiest way to prevent this from happening.
However, if you need to keep the form open after saving, you can clear the fields (with a script);  you should also set one or a number of the form fields to be mandatory (to prevent  further problems with blank records being created).
Regards,
Derek.

2,159

(6 replies, posted in General)

Hi Adam,
I just did a 'clear search fields' when you first run the application and a dbupdate.  Does this fix it?
Derek.

2,160

(13 replies, posted in General)

Hi David,
Thanks for the project.  I made a couple of changes that I hope address the points in your original post and then made one or two alterations as they occured to me going through it.
1.  I added a relationship between the items and the purchaseorder tables so when you add items, it automatically adds the tracking number to maintain the relationship.  This works whether you add items at the same time as adding an order OR if you add an order, save it and then add items at a later stage.
2.  I changed the search comboboxes on the purchaseorderlist form to be incremental so the user doesn't have to click 'search' (now hidden).  This gave me some space so I added a 'clear all' button to save users having to clear  the combobox searches individually (I know, we spoil them too much!!).
3.  Branch was a combobox dropdown on the purchaseorderrecord form so I added it as a combobox search on the purchaseorderlist form as well
4.  I added running totals to all the tablegrids
5.  The 'total price' field on the item form now calculates automatically
6.  I added a couple of calculated fields so you can a) see what the running total of all 'tracks' is on the purchasorderlist form and also added a flag to show whether there are any notes.
There wasn't much to do in the script but where there was, I've commented it so you can easily change/remove it.
Hope some of the above helps,
Regards,
Derek.

2,161

(13 replies, posted in General)

Hi David,
If you could attach your project, it might help to highlight any issues.
In the meantime, I took an old project and changed it to be more in line with what you described.  Is this roughly the sort of thing you're meaning?
Regards,
Derek.

2,162

(15 replies, posted in General)

Hi Manixs,
Please have a look at the attached example.
I am not sure if you want to color the whole row or just the cell so I have shown both ways.
The condition for colouring can be any value from any column that has been defined to the tablegrid (even if the column is made invisible, as I have done in this example).
Hope this helps,
Derek.

Hi EHW,
Guilty as charged - LOL!  And thanks for the explanation.
Derek.

2,164

(11 replies, posted in General)

Hi Nitin,
I would use a calculated field with substring to reformat the date to how you need it to appear in the tablegrid.
Have a look at the attached example;  it's not very sophisticated, but it works!
Depending on how your date is held, you may need to adjust the substring parameters in the calculated field but the principle is the same.
Regards,
Derek.

2,165

(5 replies, posted in General)

Hi Adam,
Is this the sort of thing that you're after?
It was easier to start with a blank script so you might want to cut and paste this back to your original (or vice versa).
Derek.

2,166

(2 replies, posted in General)

Hi Terry,
If I'm understanding your question, I'm guessing that when you display your tablegrid, you get the first related field displaying properly but all subsequent related fields just display their record id.  When you relate 2 tables more than once, you need to use calculated fields to temporarily hold the extra related details and place those calculated fields onto your tablegrid.
Have a look at the attached example and see if this is the sort of thing that you are trying to do.
Regards,
Derek.

2,167

(6 replies, posted in General)

Hi Manixs,
By default, MVD starts with the form that is the left-most of your defined forms.  So, if you have Form1, Form2 and Formlogo created as forms, simply drag the Formlogo tab to the left and then it becomes your starting form.  Then all you need to do is add a button to Formlogo that calls Form1.  There are actually quite a few different ways of doing it.
My attachment is a logo that is on a timer (but you can just have the logo and manually close it by editing the script).
Maybe this will give you some ideas,
Derek.

Hi DBK and EHW,
Also knocked up a quick demo project (see attached) - I clearly have too much time on my hands - LOL! 
I was trying to see how close it could get to the requirement without using any script but in the end I had to give in and add a few lines!!!
Anyway, hope it helps to move things forward for you.
Derek.

EHW - neat way how you toggle between the edit field and the combobox for the stock or non-stock items.  Just one thing - can you explain  what does the Prod_Lookup.TableGrid1.PopupMenu := nil;  line do?  It's not something I've come across before. 
Thanks.

Hi DBK,
In its simplest form, I think you only need to add a new field to the invoice_details table to hold the 'non stock item' and create your relationship to the stockitems table as optional.  Then in your input form, simply have a combobox (for stockitems) and an edit field (for nonstocked items).
Obviously, you could do a lot to smarten up your forms and grids (perhaps display both stocked and nonstocked items in the same column etc) but as a basis, I can't see why this sort of approach shouldn't work for you.
Regards,
Derek.

2,170

(4 replies, posted in General)

Hi Mathias,
How's things?  Thanks for having a look.  I was approaching it  from the wrong end (see Dmitry's response).  You use the 'time' part of the datetimepicker field, define that as your database field and then link it to the 'date' part.  I wouldn't have thought to do it that way and it doesn't seem very intuitive but at least we know if we need to do something like that in the future.
Regards,
Derek.

2,171

(15 replies, posted in General)

Hi Manixs,
The 'time' part of datetimepicker needs to be set up as the primary element and defined as your database field, not the 'date' part as I was doing. 
You then associate the 'date' element (undefined)  with the 'time' element.  I hope that makes sense.
I've attached the original project with it fixed (even though I see that you've now got it working by using separate date and time fields).
Regards,
Derek.

2,172

(4 replies, posted in General)

Hello Dmitry,
Have you been able to have a look at this problem?
Thanks,
Derek.

2,173

(15 replies, posted in General)

Hi Manixs,
I was able to recreate what you found but I don't quite know how to fix it. 
I think it might be a bug so I have messaged Dmitry and asked him to have a look at it.
If he can't find a solution, a way around it is to use 2 separate fields - 1 date field and 1 time field (rather than use a combined date/time field).
I will get back to you when I've had an answer.
Regards,
Derek.

2,174

(26 replies, posted in General)

Hi Adam,
The script was getting a bit messy so I've re-written some of the procedures and simplified them.  The problem you were encountering shouldn't happen now (yes, I know that's what I said before - LOL!). 
Derek.

Hi Dmitry,
Can you have a look at the following problem please.
I have a datetimepicker field in my test application. 
When I ADD a record, if I set the date and time fields to be something other than the default date and time, only the date element is saved correctly - the time element is always saved incorrectly as the default time  (see screen captures 'dmitry1' and dmitry2' in the attached project). 
I then need to AMEND the record to correct the time element. 
Is there something that I have set up incorrectly?
I am using MVD 3.5.
Thanks for your help.
Derek.