601

(12 replies, posted in Reports)

Dimitry,
I was wondering if I could ask a favor of you. In your Customer Invoice example, could you demonstrate how to do calculations in the group-footer of the print invoice design. For example, say you have a discount rate stored in your client table and a tax rate also stored on the client table. After your summation of the invoice items, can you show the calculations for discount amt (sum * discount rate) and tax amt (sum * tax rate) and then the invoice total (sum - discount amt + tax amt). Thanks a bunch.

602

(9 replies, posted in General)

Derek,
Your example is definitely an efficient way to consolidate comboboxes. I've done that with other software products. Your method is certainly the way to go in your specific project and would stick with it.

603

(9 replies, posted in General)

Derek,
I have found you can also do the following. I had the same situation as you, where I wanted dropdown lists that were not connected to a database. It works and you can still use "dbItemId", if you want.   Just place these assignments in your Form OnShow event.

     Form1.Month_ComboBox.Clear;
     Form1.Month_ComboBox.dbAddRecord(-1,'');
     Form1.Month_ComboBox.dbAddRecord(1,'Jan');
     Form1.Month_ComboBox.dbAddRecord(2,'Feb');
     Form1.Month_ComboBox.dbAddRecord(3,'Mar');
     Form1.Month_ComboBox.dbAddRecord(4,'Apr');
     Form1.Month_ComboBox.dbAddRecord(5,'May');
     Form1.Month_ComboBox.dbAddRecord(6,'Jun');
     Form1.Month_ComboBox.dbAddRecord(7,'Jul');
     Form1.Month_ComboBox.dbAddRecord(8,'Aug');
     Form1.Month_ComboBox.dbAddRecord(9,'Sep');
     Form1.Month_ComboBox.dbAddRecord(10,'Oct');
     Form1.Month_ComboBox.dbAddRecord(11,'Nov');
     Form1.Month_ComboBox.dbAddRecord(12,'Dec');

604

(2 replies, posted in General)

Ok. Thank you Dinitry.

605

(2 replies, posted in General)

Dimitry,

If I have an existing MySQL database and I want to create an MVD project to access the existing MySQL database, how do I get the MySQL table definitions into the MVD development environment on the "Database Tables" tab?

606

(29 replies, posted in General)

Jean - I totally agree, all apps should be designed and built to suit the needs of the end user and their workflow. It's got to be as easy and simple as possible. Most Windows programs probably could be built without any kind of menubar. There's really no right or wrong way. I guess the right way is what the end user actually requires. Most users of Windows programs come to expect some sort of menubar and maybe Roger's user(s) is one of them. Maybe Roger can show them an alternative. Based on what I have learned from Dimitry's example, it could get quite involved building menubars throughout the app especially if there are a lot of forms. I agree it can be disruptive to bounce around forms by placing all your forms in a menubar of all the other forms. Not knowing Roger's user requirements, this forum can only try to help him get to where he needs to be if possible.

Derek - It's funny you mentioned a "false" form. That's exactly what I did in my project while testing MVD. Most Windows applications have a main application window from which dialog boxes, forms, reports, etc are displayed within. I noticed very early on in evaluating MVD that this is not the case with MVD. All forms which are not maximized open up over your desktop or whatever program is running behind the MVD form. So I created as my first form a backdrop window (maximized). From there you can go to a login form or whatever is the real first app form through a script, not a button. Essentially all forms from that point on look to be opened within the main window. It works and it looks more professional. I know this is off topic from the menus, but I thought I would mention it to you since you said "(can't imagine why though)"  :-)

607

(29 replies, posted in General)

Roger and Others:
I'll be upfront with you, I am brand new to MVD and Pascal. I've only been around it for about a month, but I was able to follow Dimitry's example and I expanded his example a little to actually show File menu navigation on other forms. See if this is what you are looking for. If I'm off base, sorry.

608

(20 replies, posted in SQL queries)

Derek,
At this point I'm only evaluating MVD. During the trial period I'm just building a rudimentary system to make sure I can do everything the design calls for. So far the software seems pretty strong.  I've been able to do most everything. The only drawback I see in the software so far is that too many properties need to be set using scripts. All properties should be done on the component design and scripts should only be needed to override those properties during run time. I understand that the new beta version has more properties which may take care of my issue. I have not tried it during the trial. I didn't want to mix my testing and evaluation on a beta version. The only other thing that bothers me is that the documentation is weak. The new help system is a huge step in the right direction. I believe it can be improved upon by defining ALL the functions available in MVD, ie String manipulations, date functions, etc, etc. I tried using things from Delphi Basics, but apparently there are discrepancies between Delphi and MVD. I'm definitely not a Pascal expert, but I've learned other languages fairly easily in the past if I have a good reference manual. I've learned some things from this forum, but if Dimitry ever got hit by a beer truck we might be in trouble. And it sounds like he is the author and developer of MVD. That scares me if something happened to him or he decides not to keep the software up-to-date any longer. Other than that, I think the software is pretty decent and easy to use.

609

(20 replies, posted in SQL queries)

Derek,
I'll try to explain my reasoning for the separation.  It's a Lead/Client type scenario where the first table are sales leads and the data points are all around the sales process and the various stages of the process. The second table is just clients with a whole different set of data points. Yes you are right in that I could have stored everything in one table with some sort of status field to identify the lead versus a client. But I elected to separate them because the lead record basically becomes an historical record never to be changed or manipulated. It's used for statistical reporting around marketing and sales campaigns, etc. Also, not all leads become clients. The client table is a separate entity with a whole different structure. Quite frankly the only thing that is duplicated is the name, address, phone number and email and if those fields get changed on the client record, it's alright and preferred that the Lead record does not get updated. Everything else in the client record is completely different. Think of it this way, the Lead record basically is a snapshot of the client at the time they became a client. The Lead Id is being stored on the client record so a user could take a look at the lead information if desired, but usually is not necessary. There will be controls in place to disallow changes and deletions of the Lead record once the lead becomes a client. So there is really no synchronization necessary between the two tables. They are separate entities. I hope this clears up any confusion and my reasoning for the separate tables. It's all good. It's workable. :-)

Thanks for your input Derek and trying to lookout for me and keep me out of trouble.

610

(20 replies, posted in SQL queries)

Thank you Dimitry. That clears it up. I appreciate your quick response.

611

(20 replies, posted in SQL queries)

Sorry guys, I had family obligations over the weekend and couldn't reply sooner.

Dimitry - You got it. That's what I was looking for. Thank you. The key to it was Last_Insert_id(''). I was not aware of that function and couldn't find it anywhere. A question I have is what are the double quotes for inside the parentheses?  Also I noticed that you use Form1.GridParent1.sqlValue to get the Id field. I thought dbItemID was used to get the Id. So can they be used interchangeably?

Derek - Very astute on your part. Essentially the two sets do become more or less independent sets. Changes/Deletions on the "copied" version is quite alright. I will have controls on the original parent/child set to restrict changes/deletions once a set is copied. The original becomes a sort of historical record at that point.  Thank you for your observations and advice.

612

(20 replies, posted in SQL queries)

Tcoton question: single record means one table row.

Derek:
Question 1: Just occasionally (yes a manual request on a form button). Second parent will not have the same number of rows.

Question 2: Yes this is true for the child tables. And yes your scenario is correct. Don't always want a parent row copied, but when I do I always want the child records to be copied.

Question 3: Yes

613

(20 replies, posted in SQL queries)

No, that's not what I'm looking to do. It's actually much easier than that. I thought I attached a picture of the DB schema, but it didn't come through. I'll try again.

614

(20 replies, posted in SQL queries)

Yes you are both correct. It's definitely not complicated in theory. I just don't know how to structure it in an SQL statement. The parent copy I'm sure can be done using an Insert....select type statement, but bringing over the child records and assigning them to the newly inserted parent record is my hang-up.
.

615

(20 replies, posted in SQL queries)

Not sure if an SQL statement can be created to do what I want to do or maybe some other way, but here is the scenario. I have a parent / child table relationship. I want to take a few fields from a single record in the parent table and insert a new record in another separate table. Along with that I want to bring over the child records of the first parent and insert them into a child table of the second parent table where I just inserted the parent record. Obviously the related Id in the child records need to be set to the newly created parent record Id.  Any help would be appreciated.

616

(3 replies, posted in General)

Forgive me, but I'm still new at this. I looked through this forum and on Delphi Basics for Pascal Date routines. I need to add days to dates. Delphi Basics says that IncDay can be used to increment by days, but apparently MVD does not like it. How does one do date calculations? And also, are there any functions for dates falling in a period such as "This Week', "Next Week", "This Month", "Next Month", "This Year", "Next Year", etc?.

617

(5 replies, posted in General)

Derek,
I thought about doing that too, but as you said if the columns get resized it could be a problem. Thank you anyway. I'll use Dimitry's solution for now.

618

(5 replies, posted in General)

Thank you Dimitry. Maybe changing header fonts and size can be a feature in a new release.  And maybe column wordwrap can be more or less a property in a future release, to reduce coding in scripts. But at least there is a solution right now for it.  Thanks again for your response.

619

(5 replies, posted in General)

Is there a way to format Tablegrid headers (font, size, color)?  And is there a way to do a word wrap in a specific column?

620

(9 replies, posted in General)

Perfect, Derek. I adapted what you did into my project and it works beautifully. Thank you so much for your help. I really do appreciate it. It's good to know that the support on here is dependable especially as I am testing and evaluating this software.

621

(9 replies, posted in General)

Wow Derek, very nice. What you did there was actually one of the views into buyers and sellers that I had planned to do. Thank you. I appreciate it. I even got some more insight into some of the things that scripts can do. I was wondering if you don't mind, I would like to see how you would place a buyer grid on your "sellercrud" form and get that working (showing the appropriate buyers) when changing the Business Type and when in add mode for a seller. Thanks Derek. I do appreciate your assistance.

622

(9 replies, posted in General)

You're awesome Derek. I got it working using your concept. Since I don't have a seller tablegrid on the Seller form, I couldn't use your incremental search feature. However I used your button concept to do an auto search on the Seller form by placing the script function for clicking the button on the form OnShow event as well as the Business_Type combobox change event. It works perfectly (almost - lol).  Although it's not really a show stopper, here is the only time it does not work properly. If I have a buyer who has a Business_Type of let's say "Auto Repair" and I don't have any sellers currently with "Auto Repair" Business_Type, but in the future I have one and add the new seller on the Seller form. When I select "Auto Repair" for the Business_Type for the new seller, I expect the buyers with "Auto Repair" to show in the grid, but it shows an empty grid. However, after saving the Seller record and then go back into the form, the buyers with "Auto Repair" do show up as they are suppose to. I can also change the Business_Type in the combobox and the correct buyers show.  So I know the button search is working but not when a new seller is put in as the first time seller with the same Business_Type as an established buyer(s). Like I said, I could probably live with it. Just wondering if there's a way to get it to work in that situation.

I've learned a lot just from your example Derek. I learned about the Incremental search feature for a button and that apparently search results override Tablegrid settings for what's displayed in the grid box. Bear with me, I'm trying to get a handle on this software. Thanks again Derek.

623

(9 replies, posted in General)

Thank you so much Derek for your response. You are definitely on the right track.  What I would like to see is the buyer grid on your "Seller" form rather than the "SELLANDBUY" form.  I'm assuming the "Button1" you have on the "SELLANDBUY" form is what makes the buyer grid work there, although I'm confused how it does work because it is hidden, but apparently is triggering the search to load the buyers. Maybe you can shed some light on it a little more.  Thanks a bunch.

624

(9 replies, posted in General)

I am brand new to this product so bear with me. I'm trying to learn all the various nuances of MVD. I have a sort of master-detail situation, but not in the traditional sense. I have three tables. One is a SELLER table which contains businesses who are looking to sell. A second table is a BUYER table which contains potential buyers for the businesses for sale. These two tables in itself are not directly related. Neither one is a parent nor a child to the other. They are completed independent. The third table is a BUSINESS_TYPE reference table. The SELLER table has a field for Business_Type which is setup as related (foreign key) to the BUSINESS_TYPE table. This of course identifies the type of business the Seller has. The BUYER table has a Business_Type field which is also set up as related to the same Business_Type table. This identifies the type of business the buyer is interested in. Creating the database tables and the relationship is a piece of cake.

Here is the situation I need help with:
I have a SELLER form with the detail record displayed. On that same form I have a grid which I want to display potential BUYERS for the seller currently displayed on the form. I have the table grid defined for BUYERS, but I need to filter it by the same Business_Type  as the seller displayed on the form. I tried using the filter field in the settings for the tablegrid, such as "Buyers.id_Business_Type = Sellers.id_Business_Type". But that resulted in showing all the buyers having the same Business_Type for "ALL" sellers. I only want to display buyers with the same Business_Type as the seller record that is currently displayed on the form.

I'm pretty sure there is a simple solution through a query or something, but as a newbie I haven't been able to figure out how to do it in this software. Once I know how to define this, I'll be able to do the same thing in reverse whereby I can display a buyer and have a grid of potential businesses available for the buyer.  Hope you can help.  Thank you.