2,226

(5 replies, posted in General)

Hi Nitin, Hi Kim,

Your comboboxes in the 'search child filter' were pointing to the wrong relationships (looking at 'studentdb' instead of 'addcourse' and 'addsoftware'.
Also, I think it is better to have 3 separate 'search child filter' buttons because the main table is different for each filter search.  Also, you can then have a grid layout that is more specific to the filter you are using.
Please have a look at the attachment and see if this is now doing what you want.
Thanks,
Derek.

Hi Manixs,
Attached is the perhaps the simplest way of doing what you want;  there are other ways that can automate things more but they require more script.
Please note that the script in the attachment is not essential for what you want to do - it just makes the 'save' button visible / invisible;  this is to prevent accidentally duplicating records (which can be a problem when doing everything on the same form).
Hope this helps,
Derek.

2,228

(7 replies, posted in General)

Hi Adam,
Is this so it's like some sort of hint for the user?
Derek

2,229

(13 replies, posted in General)

Hello Kim,
If I understand correctly and your condition is only valid for a new record, then you could try the following test in your script:
procedure xxxxxxxx
begin
   if action = 'NewRecord' then
      begin..........
         etc etc
     end;
end;
However, the test for 'newrecord' is usually associated with the formxxxx on_show procedure so if you are using the same form for new records and for editing records, you might need to amend this.
Derek.

2,230

(2 replies, posted in General)

Hi Nitin,
Is this the sort of thing that you need?  (see attached)
Regards,
Derek.

Hi Kim,
The sql error is to do with Form3 - you have a mixture of fields from tabone, tabtwo and tabthree on this form but your 'save' button is defined to save them all to tabthree.
It would be far easier just to use different forms - one form to maintain tabone fields, one form to maintain tabtwo fields and one form to maintain tabthree fields.
Derek.

2,232

(9 replies, posted in Script)

Hi Dmitry,
I understand what you're saying about not having full control over the component. 
Instead, I have used your googlemaps api (static map) suggestion and then, if required, make an external URL call to the 'interactive' google maps.
It works quite well.
Thanks for having a look and for your help,
Derek.

2,233

(2 replies, posted in General)

Hi Nitin, Hi Kim,
If you didn't want to use a script, you could also try using a calculated field (see attached).  I've chosen to display to 3 decimal places but you can change the format to whatever you want in the calculated field.
Regards,
Derek.

2,234

(9 replies, posted in Script)

Hi Dmitry,
Please see the attachment.
Enclosed is the fixed project that you changed for me a couple of days ago.
The steps I take are:
1.  I create the executable using Version 3.4b (screenshot cf1.jpg)
2.  I click on any row in the grid and select 'Show On Map' (screenshot cf2.jpg)
3.  A browser window opens WITHIN the application which is correct -  but nothing else happens (screenshot cf3.jpg)
4.  After 3-4 second, the browser window closes and the error message displays (screenshot cf4.jpg)
5.  If I try to repeat this, I get a different error message (screenshot cf5.jpg)
If I quit the application, open it again and repeat steps 1-5 above, the same thing happens.
The browser that I use is Chrome but other users of this application may be using a different browser.
I am using Windows XP but other users of this application may be using a different Windows OS.
If you need any more information, please let me know.
Thanks,
Derek.

2,235

(8 replies, posted in General)

Hi Kim, Hi EHW,
You beat me to it, EHW - I was about to say the same thing about defining fields as 'real'.
With regard to your other issue, I see what you are trying to do but I think you'll have to:
1)  define the lower and upper values of each range (both old and new) as discrete fields - trying to determine which item falls within which range when the lower and upper range is defined in 1 text field will be very tricky.
2)  perhaps use calculated fields to determine which old range and which new range an item falls into, what the old calculated value is, what the new calculated value is and the difference between the two.  This could then be displayed in a tablegrid with totals.
(By the way, I'm presuming that your ranges do not overlap otherwise the calculation would not work).
Derek.

2,236

(4 replies, posted in General)

Hi Nitin,
I'm not sure if I'm right, but I think the problem is that your grids use 'schedulingdb' as the primary table but your filter is on a related table ('classday'). 
This is okay but your filter needs to refer to the ID of the related table not one of the fields.  So you need to change your filter from classday.classday = "Monday" to classday.id = 1  etc, etc
Please see attached (I have done it for Monday(id = 1), Tuesday (id = 2) and Wednesday (id = 3).
Hope this makes sense and helps,
Derek.

2,237

(4 replies, posted in General)

Hi Nitin,
Perhaps you can use calculated fields to replace 'Yes' or 'No' with the day of the week.
Please see attachment (I have only done it for 'Monday' and 'Tuesday' to show how it might be done).
Maybe this helps?
Derek.

2,238

(9 replies, posted in Script)

Hi Dmitry,
Thanks for having a look at this problem.
I have downloaded the changes you made (contacts_fixed.zip) as well as the MVD 3.4b from Dropbox.
When I now try to access Googlemaps from within my application, I get the following error message:
"invalid floating point operation"
Do you have any idea what might be causing this?
Regards,
Derek.

2,239

(9 replies, posted in Script)

Hi Dmitry,
Thanks for doing this. I am on vacation at the moment, but will test it when I am back home and let you know how I get on.
Regards,
Derek

2,240

(13 replies, posted in General)

Hi Kim,
There are a number of ways of doing it - the attachment is just a suggestion.
I use a 'false save' button which checks the total weights for a commodity;  only if the total is less than or equal to the permitted, does it 'click' the 'real save' button.  If the total weights are more than permitted, it displays an error.
I've added a 'current running total' so that when the user enters form3, he sees what it is.
Also, note that the combobox on form3 now shows not only the commodity, but also it's permitted weight - it just gives the user a bit more info'.
Sorry it's not very 'polished' but I'm pushed for time at the moment.
Hope this helps.
Derek.

Hi Adam,
Probably a couple of ways to do this but I'd suggest using calculated fields on the saleinv table and then displaying the total sales and total refunds values on form1.tgmaincustomerstrans (I've also added an invoice line count just to add a bit of extra info). 
This way, you see not only the total of the sales and refund values for each invoice (but without having to click on it), and you also get a grand total of sales and refund values for ALL invoices for that particular customer (see attached).  Just a thought.
Regards,
Derek.

2,242

(13 replies, posted in General)

Hello Kim,
Not a problem - I didn' think I'd really understood your app.  But some of the things I did in my previous attachment should help you no matter what the app is - the principles are always going to be the same.
When I first came across MVD, I found the best way to understand it was to search through the forum and download various apps that people had posted as part of some problem.
Good Luck,
Derek.

2,243

(9 replies, posted in Script)

Hi Mathias,
Hope things are good in your corner of the world.
Thank for having a look.  I've not had any problems on any one's PC when using 'openurl' but wanted to get it working with twebbrowser because it just looks integrated.
The map.show line is in the script to show Dmitry the steps I'd taken but if this problem can't be fixed, I can take most of that section out.
I believe there is a registry 'tweak' but I don't know every machine where my app is being used so that's not a solution for me.
Maybe Dmitry can think of something.
Regards,
Derek.

2,244

(9 replies, posted in Script)

Hi Dmitry,
Hope you are well.
In my program I click on a row in a tablegrid and it uses the postcode(zip code) to access google maps.
If I use 'openurl', it opens a new window in my browser (Chrome) and takes me to the correct web page (lines 92-100 in my script).  This works well.
But I want to show google maps displayed inside my form;  for this, I am using twebbrowser and the navigate command.  However, when I do this, I get an error message (please see screenshot1.jpg).
I can possibly fix this for my own PC but I have no way of knowing which version of which browser is installed on any other PCs where my program is running.
So my question is - is there any way of achieving this by using whichever browser is installed on the PC where my program is being used?
Thanks for your help,
Regards,
Derek.

2,245

(13 replies, posted in General)

Hi Kim,
Not sure if I understand your exact problems, but I'll have a go.
One of the issues in your app seemed to be that the two grids weren't 'talking' to each other - have a look at the attachment as a possible way to do this (it uses a 'search' function to take a specific row in tablegrid1 as a criteria to display related records in tablegrid2).  Apologies if it sounds more complicated than it actually is - once you've done a couple, it becomes very straightforward.
Another issue seemed to be some sort of calculation between the cereal weight and the summed weight of sub-entries so have a look at using a calculated field in the table structure (see attachment) to warn of this (but it's just one of many ways you could do it).
As an observation, in your app, you are using the same form to add / edit records.  It's okay to do it that way but can cause problems with duplicate records (try saving a record in your app and then press 'enter' a few times to watch the duplicates increase!).  In my opinion (for what it's worth LOL!), using a discrete form to add/edit records is a much safer option, particularly if you are new to MVD.
Hope this takes you forward a bit and please come back to the Forum if there's anything that's not clear.
Derek.

2,246

(3 replies, posted in General)

Hi Kim,
The form already exists (you need to use it to populate the initial list!), so it is easiest just to add a button that calls that existing form.  Combobox data tends not to be that volatile so it's not normally something that is being added to very frequently.
But to answer your question - yes, you can add a new item to a combobox without leaving the form and have that new item added to the database (but it needs to be done by script).
If you are new to MVD, it might be more confusing than helpful to try and work out what the script is doing but, for reference (and to prove it works - LOL!) please find attached an example of one way it can be done;  click on the drop-down combobox list and select the '+' entry and then enter your new value. 
I am sure there are also other ways that some of the other users know.
Derek.

nb:  I think this example only works with MVD 3.2 and above

Hi Kim,
Not quite sure where the problem is with deleting a record;  bear in mind that if you use the auto-increment feature, when you delete a record, that particular number does not get reallocated (ie if you have records 1,2,3,4 and 5 and you delete record 2, the next auto-incremented no' is 6;  record 2 does not get re-used).
Have a look at the attached example and see if it is doing what you expect.
Regards,
Derek.

Hi Kim,
Most of us probably start out the same way as you and then get hooked(!) when you realise how much you can do with MVD.
Attached is an example of how to switch off tabsheets you don't need (there will be other ways too - just tried to make it look like a tabbed web-browser).
Hope it gives you some ideas.
Derek.

Hi Kim,
If I understand your question correctly, then it's not really how MVD works.
Forms are opened more in a hierarchy so when you want to 'switch', subordinate forms need to be closed first. 
For me, that's the main reason to use 'page control'.  Each tabsheet becomes, in effect, a form (but with no hierarchy) which enables you to switch between tabsheets/'forms' without restriction.
If you don't want all of the tabsheets to be displayed all the time, you can set the 'tabvisible' property of any of the tabsheets to 'false' or 'true' depending on which tabsheets you want to see.
How  you best do that depends on why you only want certain tabsheets showing rather than all of them, so if you can give a bit more background to your project, then people might be able to come up with further ideas.
Derek.

2,250

(2 replies, posted in General)

Hi Adam,
Frmsalesinv edit1 and Frmsalesinv edit2 are currently blank. 
If you associate them with customers.street and customers.zip respectively, I think it should work as you want.
Derek.