1,701

(3 replies, posted in General)

Hi Terry,
I think you just need to tweak the calculated field  (see attached). 
I've also stuck a current balance calculated field at the account level as well as the transaction level so you can see an overall summary.
Regards,
Derek.

Hi,
To turn the cell yellow based on status = 'Filed'  and override the date criteria, try it like this (see attached).
Derek.

1,703

(29 replies, posted in General)

Hi,
It took a while to remember what your project does and the things that are in it!
Sometimes when you copy and paste controls from one form to another, everything works fine.  Other times, it is easy to forget to change 1 or 2 elements and it causes more problems than it's worth!
There were a couple of things that I noticed;
1.  on a couple of forms, you had fields belonging to a table 'dettagliricevuta' that no longer exists.   When you make a lot of changes to your database structure, the definitions can very occasionally get out of synchronisation!
2.  your join between 'listaricevute' and articoliricevute' was the wrong way round.  Any data you had entered into these two tables will not be showing correctly so I suggest you clear these out and start fresh.
3.  there were 'edit' buttons which were set to 'showform' rather than 'showrecord'.
4.  one of the search buttons was pointing to the wrong table.
Please see the attachment.
Derek.

Hi,
Like Thierry, I too had a project from a couple of years back that was a bit similar.
So I've changed a couple of the forms and made the data more compatible with your requirement (please see attachment).
It won't be exactly what you need but I think there are examples of how to do similar things so you can apply them to your specific situation.
There is no log-in security, but you could just bolt on the forms from your existing project.
On this project, I didn't colour code the grid - rather I have a column that show the number of days that a document has been on the system and you can sort or filter on that instead.  Or you could do both!
Also, it uses what I call (probably incorrectly!) 'hot-spots' where you click on specific cells to make calls specific to the value in that cell.  So to view a specific document, click in the actual cell where the document location is held.  Or to view a document's history, click on an actual cell in the 'Current Status' column etc etc (people I knock stuff up for like the 'interactive grid' approach!).
Hope this gives you some more ideas,
Derek.

1,705

(29 replies, posted in General)

Hi,
If Form1 is your main form (the first 'tab' on the left of your form tabs - see attached screenshot), then all the other forms are called from Form1.  So if you try to close Form1, all the other forms that are called by Form1 will close as well.
Make Form2 the first tab (drag it to the left) and then open Form1 by script.
Derek.

1,706

(29 replies, posted in General)

Sorry, but I can't quite work out what you're trying to do.
Can you attach your program?

Hi,
Not sure if I'm understanding your requirement correctly - from your code, it looks like you're actually trying to load documents into MVD to view them.  Or do you just want to be able to click a button and open documents using their default programs (Word, Excel etc)?
I would imagine it's the latter - using MVD to log where your document is held, what its status is etc etc but linking with an external call to the source document to work on it.  That's pretty much the basis of most document flow programs that I've seen. 
If this is the case, then just use the 'openfile' command in the script together with the location of the document that you are entering in form 'frmreceiving' and storing in the 'receiving' table as 'attachment2'  (see lines 7-10 in the script in the attachment).
Can I ask what the purpose of the 'filedto' table is?
Regards,
Derek.

1,708

(29 replies, posted in General)

Hi,
Yes, I would always use 'onchange' for something like this.
You might also think about putting an 'onchange' event against 'selling price' and 'quantity' as well because these are also used in your calculation and you could change these values but it wouldn't automatically recalculate until you changed (or re-entered) 'percentage gain'.
Rather than repeat the calculation on each 'onchange' event, I put it in my own procedure (because it's easier to maintain - if you change the calculation, you only have to change it in one place in the script).
Derek.

1,709

(29 replies, posted in General)

Hi,
I always try to keep things simple (LOL!) so in this example, I would use the percentage value that you enter in form1.edit4 directly - there is no need to create a separate variable.
procedure Form1_Edit4_OnChange (Sender: TObject);
begin
  Form1.Edit5.Value:=(Form1.Edit2.Value * Form1.Edit3.Value) - (form1.edit4.value / 100);
end;
Please see attached.
Derek.

Hi Terry,
Is this any good to you (see attached).
It's part of an old project but it sounds like it's the same sort of thing that you're wanting to do.  You can make deposits / withdrawals out of sequence (different days, same day different times etc) and the running balance should always recalculate.
Derek.

1,711

(11 replies, posted in General)

Hi Manix,
Another way of doing it is to copy all the values from the selected tablegrid row onto a form.
You don't have to re-type all the details but it also gives you the option to change some of the copied details before saving the record (I'm not sure why you might intentionally want to create duplicates).
Derek.

1,712

(29 replies, posted in General)

Hi,
In your script, first declare your variable
var  variable1: string; 

and then
variable1 := form1.edit1.text;

Derek.

1,713

(29 replies, posted in General)

Yes, you understand it correctly - calculated fields are temporary and only exist when the program is running.  Saved fields exist even when the program is closed.

1,714

(29 replies, posted in General)

Hi,
There are a couple of things to understand when using calculated fields.
Calculated fields only exist while your program is running - as soon as the program closes, the calculated fields are gone.  For example, you would save someone's date of birth but you wouldn't save their age - that would be data redundancy.  Instead, you calculate their age every time the program runs using a calculated field so it is always up to date, but as soon as the program closes, their 'age' is gone.
So you are correct when you say that there are no instructions DIRECTLY relating to calculated fields in the script.  But what the script does is
1)  run a search when the program starts so that all the columns in the tablegrid are populated - including calculating the calculated fields.
2)  when any data is saved, the calculated fields need to be 're-calculated' - this is what the 'dbupdate' statements are doing in the script.
So when you removed the script, the calculated fields didn't appear because you removed the instruction to calculate / re-calculate them.
I hope I've explained that okay.
I've attached the project again with some comments in the script that may help.
Regards,
Derek.

Hi,
If you want to filter by employee name as per your attachement, the syntax is employees.name = "Joelen".   However, hard coding in this way is generally not such a good idea.
Filtering by search using a combobox has the advantage that nothing is being hard-coded into your program so you don't have on-going maintenance issues.  It also means that everything can be achieved by using just one form (Form1) rather than creating forms for each discrete employee.
Derek.

Hi Thierry,
Nice one!  Never seen it done like that before.
Kudos!
Derek.

1,717

(29 replies, posted in General)

Hi,
Perhaps try it like this (see attached).
Derek.

Hi g0dmenuelz,
As Manixs suggests, you could add a second numeric column, hide it and then sort on it.
But a simpler trick would be to use 2 digit numbering - instead of 1, 2, 3 etc, use 01, 02, 03 etc.
Obviously if you have more than 99 search results, you need to use 3 digit numbering.
I think it looks better anyway because the numbers and the text 'line up' (just a personal preference).
Derek

1,719

(2 replies, posted in General)

Hi Dmitry,
Understood, and thanks for checking.
Derek.

1,720

(29 replies, posted in General)

Hi,
I would use 3 tables as follows:
1.  Customer (basic information)
2.  ReceiptSummary
3.  ReceiptDetail
The relationship between Customer and ReceiptSummary is 1:many.
The relationship between ReceiptSummary and ReceiptDetail is 1:many
This allows one or a number of customers to sell one or a number of items on one or a number of different days.
Please have a look at the attached example and see if it helps.
Regards,
Derek.

1,721

(2 replies, posted in General)

Hello Dmitry,
I am using a MonthCalendar and some of your code to display selected dates in bold. 
But it is still not very easy to see the seleted dates (please see attached).
In addition to displaying selected dates in bold, Is it possible to add a function that can either change the background color of the selected dates or change the text color of the selected dates so that they are more noticeable.
Thanks,
Derek.

1,722

(3 replies, posted in General)

Hi Adam,
I wrote the attached a while back now - perhaps it's the sort of thing that you're looking for.
It's nothing fancy - I just needed something that I could quickly jot down notes/reminders for without all the bells and whistles you get with most 'reminder' programs.
Regards,
Derek.

1,723

(2 replies, posted in General)

Hi Manixs,
Is this the sort of thing that you want? (see attached).
When you click on the 'search' button, it shows a 'records found' count as a pop up message.
Regards,
Derek.

Hi,
The exact calculation depends on how you're holding your data but the syntax is something like the calculated field in the attachment.
Derek.

1,725

(6 replies, posted in FAQ)

Hi,
71 dictionary tables seems a lot, but maybe that's just the nature of your application.
Just a thought but if you want to further reduce the number of forms, rather than creating 2-3 summary forms, you could try putting ALL your dictionaries on one form, use a page control and then sub-divide them logically onto discrete tab sheets (see attached). 
But make sure you back up your project frequently - I have a habit of accidentally deleting page controls (my bad!).
Derek.