Hi Gonpublic,
Are you meaning like some sort of audit log?
In my attached example, when I go into the relevant form, I hold the existing 'name' and then check to see if any changes are made to the 'name' field.  If yes, I save both the old and new values together with a date/time stamp into an audit table which I can  then view to see a history of changes.  In my example, I've decided that I'm not interested in tracking any other changes, but obviously you can decide what is and isn't important to you.  And to help the user, I add a counter to show which rows of data have had changes to any field that is being audited.  Just click on the 'Audit Log' button to toggle the audit panel on and off.
I couldn't think of any different approach to take and it could do other things like getting the name of the user who makes the change etc etc, but hopefully it gives you an idea.
You can't use one button to save records in two discrete tables.  But what you can do is to attach an 'on after click' action to the first button that then, in a script, automatically clicks the second button (I'm actually doing it in the attached example);  hide the second button and the effect is that one button saves both records.
Derek.

2,277

(17 replies, posted in General)

Hello Timlitw,
Not sure if I'm missing something (probably - LOL!).  Can't you filter the comboboxes in the same way that you filter the grids (using the vlocation filter in my previous attachment).  That was the thinking behind the approach I took to make it re-usable.
The relevant code (in my attachment) is:
formcalculate.combobox1.dbFilter := 'location = "'+vlocation+'"';
formcalculate.combobox1.dbupdate;
I've added it to this attachment (user passwords are 100, 200, 300, 400 and administrator passwords are tim, derek).
Let me know if I've missed something.
Regards,
Derek.

2,278

(17 replies, posted in General)

Hi Timlitw,
I get the relevant user location from the password table using the entered password as the key and store it in a variable (vlocation).
I then pass that location through as a 'real time' filter to the grid with :   
form1.tablegrid1.dbfilter := 'location = "'+vlocation+'"';
It seemed an easy way of automating what you'd otherwise do manually with a 'search' button and a combobox filter.  But because it's done programatically, it stops the user being able to see locations other than their own (unless you're an administrator) yet also allows hundreds of locations to be added without needing any modifications.  And because vlocation is global, the code can be re-used against any tablegrid in your project where you need to restrict location.
So, from what I understood of your requirement, it seemed to offer a 'win-win'.
I downloaded your attachment - it looks an interesting project.
Derek.

Hello Gonpublic,
What you've described is certainly possible in MVD.
However, without knowing more about your project, your database design and the process flow, it's difficult to suggest options. 
My initial question is why you need the split across two forms if the additional actions information is to be saved to the same record (or is the additional actions information being stored in a related, one:many table)?
Could you attach a copy of your project?  That would help a lot.
Derek.

2,280

(5 replies, posted in General)

Hi Lupo1st,
Putting the sum of 'JA' or 'NEIN' into the grid footer is a bit awkward - it will usually show the number of rows displayed in the grid.  For example, you have 5 rows, 3 are 'JA' and 2 are 'NEIN';  the grid footer will normally show 5 or you can filter the 3 'JA' records but then you don't see the 2 'NEIN' rows (which you may want to see).
One way to combine these things that I have used before is to calculate by script the number of 'JA' records, the number of 'NEIN' records and then show the totals as button captions.  You can then also click on the button to filter the records. 
Alternatively, you could just display 3 grids on the same form - a grid with ALL records, a grid with just 'JA' records and a grid with just 'NEIN' records.
Perhaps either of these options may help you?
Derek

2,281

(17 replies, posted in General)

Hello Timlitw,
I didn't realise you'd have so many locations.
So, I've altered my original approach to allow for this;  whatever the user location, the script just reads it and filters a common tablegrid accordingly.   The user only sees the data for their location.  As an administrator, you get to see ALL locations and to maintain the reference tables (passwords, locations etc).
Valid administrator passwords are 'derek' and 'tim'  Valid normal user passwords are 'celtic', 'derry', '100' - but you can see them all in the passwords table if you go in as an administrator.
Because there is hardly any data, I also put the location into the caption at the top of the form (as confirmation that it is switching locations correctly, according to the user you've logged in as).
I think this should address the concerns about the possible number of locations that you have.
Derek.

2,282

(9 replies, posted in General)

Hi Adam,
Yes, it's very much possible and what I was referring to in a previous post - duplicate form processing (for want of something better to call it - LOL!).
So all I've done is take your attachment and made the two forms look identical.  To the user it seems like it's all on the same form.
But by using two forms, you play to the strengths of MVD and don't have to worry about the extra problems that using a single form creates (toggling enabled/disabled objects, refreshing grids, accidently creating duplicate records etc).   And creating a second, identical form is pretty quick - just set the overall new form's dimensions to be the same and then copy and paste the objects across.
Derek.

2,283

(11 replies, posted in Script)

Hi Gonpublic, EHW,
Attached is one approach you could take (there are lots of others - but this keeps it pretty basic).  It uses different tablegrids - one showing all columns and allowing maintenance, the other showing limited columns and display only;  which tablegrid you see is dependant on your level of access (determined by your password).
The current passwords to gain access are 'DEREK' (for full access) and '12345' (for restricted access).  However, if it's the first time the app is run, security is by-passed and takes you straight to a password set-up screen where your first entry must be a password with FULL access;  if you wanted to check this out, simply delete the sqlite.db file and run it as if it was the first time.
Hope it helps,
Derek.

2,284

(17 replies, posted in General)

Hello Timlitw,
I've modified one of my apps to see if it might get you a bit closer to what you want to do.
I use a password table with 2 fields (password and location) and then automatically filter tablegrids depending on the location associated with that password.
Try different passwords and you'll see how it points you to different locations (warehouses in my example);  it's all transparent to the user.
Table maintenance (click the 'database' icon to see a full list of passwords and their locations that have been set up) is only permitted against a password that has a location of 'ALL' (this is typically your supervisor/administrator).  In the attachment, the passwords that have 'ALL' associated with them are 'A1B2C3' and 'eish' which you'll need to run the application. 
It's a pretty simple solution (but that doesn't necessarily make it bad - LOL!!).
Hope this helps to move things along.
Regards,
Derek.

Hello Gonpublic,
Have a look at the attached.  You can either display what you want into fields or, as they are not connected to any DB, you could simply display them as labels.
Derek.

2,286

(9 replies, posted in General)

Hi Adam,
A 'senior moment' on my part! 
What I was querying was the mix of 'enabled' and 'read only' properties (not 'enabled' and 'visible', as I wrote in my previous response).
Apologies for the confusion.
Derek.

2,287

(9 replies, posted in General)

Hi Adam,
1.  As I said in an earlier post, any field, button etc that is contained within a panel is subordinate to the settings of that panel.  So it's just one line to enable or disable a panel AND all the objects within it rather than all the extra lines of code you have by doing it object by object.  I'm not sure why you do it that way.
2.  Is there a reason why you mix the 'enabled' and the 'visible' properties?  Enabled=false means that the user sees the object but can't click into it whereas Visible=false means that the user can click into it but then can't type.  Personally, I think it might be confusing for the user.
3.  I've just quickly modified your project so that you can scroll or click through the grid and display values in the edit fields;  this is achieved by issuing an 'edit' click in the script every time you scroll or click in the grid.  In effect you are permanently in 'edit' mode - the script then repositions you back onto the highlighted grid row to give the effect of scrolling and displaying. 
4.  The actual edit button that is visible on the form is fake!  What it actually does is to enable / disable your panels.
It takes a few minutes to get your head around this approach and there are other ways of achieving the same effect (duplicate forms, for example, which personally I prefer as it uses more of standard MVD).
Derek.

2,288

(9 replies, posted in General)

Hi Adam,
Since all of your fields and buttons are contained within the panel, all you need to do is set the default state of panel1 to enabled = false.
If add or edit is clicked, then the script is simply form1.panel1.enabled := true;  and attach it to the onclick events for the add and edit buttons.
To then disable the panel, attach form1.panel1.enabled := false to the onclick event for the save button.
I think you'd want to check for the user changing their minds, so I'd also disable the panel if they click back in the grid for example etc etc.
I'd also make one of your fields mandatory to prevent blank records being created (or do a pre-save check).
I'm not sure why you want to clear out your fields - if you have more fields than can be displayed in the grid, wouldn't you want your users to see the contents of the fields in the panel?
If it's any use, have a look at the attached - a (very) basic contacts program that does everything on one screen with panels being enabled and disabled (and also buttons hidden / displayed).
Derek.

2,289

(8 replies, posted in General)

Hi Adam,
I don't know if Dmitry has something specific that he can suggest. 
But 'accordions' aren't really much more than clicking on a label to pop open a panel or another label (or a tablegrid or an image etc etc).
See if the attached gives you any ideas.
Derek.

2,290

(11 replies, posted in Script)

Hello Gonpublic, EH,
Welcome to MVD.
Yes, you can do exactly the same thing with photos (and pretty much everything else).
Please see attached for some options (in MVD there are always many ways to do things).
Hope this helps,
Derek.

2,291

(11 replies, posted in General)

Hi Adam,
Meant to follow up on your question but have been tied up.
Rather than have lots of SQL statements to retrieve fields that you want to display, you can do most of it as part of standard MVD. 
Basically, in your script, you automate 'clicking' an edit button so as you scroll through your grid, it retrieves as many fields of data as you want without any additional SQL calls.  And because it is pretty much standard MVD, there should be no issues with refreshing and updating.
Have a look at the attached project and it might give you a different approach.
It's something I did a while back but I've changed some of it to be relevant to your question.  I use panels instead of page controls / tab sheets but the principle is identical and there is a mix of data coming from both the main and the related tables.
Although there are a few lines of code in the script, 95% of it is either cosmetic or to safeguard against the user creating duplicate rows (because it's all on one form).
Hope it helps,
Derek.

2,292

(3 replies, posted in General)

Hi Timlitw,
On the face of it, it sounds like you just need to pass through form1.tablegrid1.dbitem to the sub-form to relate the two together - but maybe I've misunderstood your question - any chance you can attach your project (or an example) so we can better understand the problem?
Regards,
Derek.

2,293

(11 replies, posted in General)

Hi,
It's the same principle - the only difference is that the incremental search is already being used to retrieve student details (so you need to add another button to search for the courses and action the 'click' in the script instead).
You were also retrieving the course details when the value in the schools grid was changing rather than when the value in the courses grid was changing.
One more thing - you really need to repeat all your sql calls AFTER you've done an 'edit' as well, because the updated details will not show (try editing some data on either a student record or a course record and you'll see that your changes are not showing - it's different from just issuing a 'dbupdate' command).  It's probably quite inefficient and will make the script rather long-winded (well, you know how I love a minimal script - LOL!).
Anyway, I think it's doing what you want now.
Derek.

2,294

(11 replies, posted in General)

Hi Adam,
Just had a quick look but haven't had time to test it properly (in a rush!!).
Is this what you are hoping to do? (I've done it for students but not for courses).
As always with MVD, other ways of doing it, but this might be one approach.
Regards,
Derek.

2,295

(2 replies, posted in General)

Hi Stelios,
I'm not sure if I understand 100% (but it's not your english, which is good - it is just my understanding of your problem!).
Is the sample project in the attachment the sort of thing that you are trying to do?
Regards,
Derek.

Hi,
If you first create a new, empty form, you can then copy all of the elements from one form across onto the new form (using ALT and SHIFT as described earlier).  It's the closest thing to duplicating forms.
Please be aware that properties, actions etc that you have attached to any of the elements will also copy across.
Derek.

Hi Timlitw,
If you hold down ALT and SHIFT and then click on any of the elements on the form that you want to move, that should do what you're after.
Derek.

2,298

(5 replies, posted in Script)

Hi VascoMorais,
I have just seen your post.
If you want to see if people are changing records (making mistakes etc), the attachment might be of some help to you.
I have made a quick change to one of my projects to show how I create a very simple 'change log' to keep a history of records that have been altered.
It is a different approach to what you were asking about but achieves the same result so it may be of interest.
Regards,
Derek.

2,299

(5 replies, posted in General)

Hello Itzik, Timlitw,
I have only just seen your post so maybe you have a solution already.
I have a user who also wanted the tablegrid to have a filter function like EXCEL. 
What I came up with is the nearest that I could get it.  It's not 100% what the user wanted but it's okay. 
Maybe this approach can give you some ideas (please see attached).
Regards,
Derek.

2,300

(5 replies, posted in FAQ)

Hi Frehak,
Glad it helped.
As you may already know,  a good place to get some help on MVD is - www.myvisualdatabase.com/help_en/
But I have found most help here in the forum by downloading other users' example projects and seeing how they have approached things, by searching through the forum topics and by submitting questions if I can't find the answer - there is almost always someone who will try to help.
Regards,
Derek.