Topic: Field calculation and Drawing Lines query

Hi,

I'm trying to create my first database!!.

I have 2 fields. One is a date field and another is a dropdown. What I would like is to have another field populated with a date that is either 2 or 6 weeks after the date in the date in origbal date field. The 2 or 6 weeks would depend on the value of the dropdown, 2 weeks if the dropdown value is RAIT and 6 weeks id it is ICT.

Also, am I able to draw lines to separate areas??


Thx,

John

Re: Field calculation and Drawing Lines query

Hello John,
MVD offers many different ways but I'd do it something like this (see attachment);  I've cut corners by creating the drop down directly in sqlite and hard coding the date intervals (which you wouldn't normally do) but it gives you the general idea.
Lines can be drawn to separate areas using panels (defined as thickly or as thinly as you want) but you can also use panels to wholly enclose areas.  Another option is to use groupboxes (although you don't have the same choice for changing colours). 
Hope this gets you started.
Derek.

Post's attachments

Attachment icon snapper dates.zip 338.41 kb, 362 downloads since 2016-10-28 

Re: Field calculation and Drawing Lines query

Just to add to Derek's solution regarding drawing lines, you can also use images to create lines. You can create an image (solid or gradient) outside of MVD with any image editor and insert it into your MVD project forms. It does not matter what the size of the image is. You can use the same image for all your lines in all forms if you want. You can stretch the line as wide as you want and make it as thin or thick as you want.  I used Derek's example attached and added image lines at the bottom of fieldform to create a box. I have a gradient image inside the box that can be used as separators / headers also. Both images are in the image folder within the project folder. No one way is better than the other. Just giving you options.

Post's attachments

Attachment icon snapper dates (2).zip 584.59 kb, 368 downloads since 2016-10-31 

Re: Field calculation and Drawing Lines query

Hi Guys, I've managed to implement the dates using dictionaries, a big step for me!!!. I'm also using your drawing lines advice smile

Thx,

John

Re: Field calculation and Drawing Lines query

Hi John, Hi EHW,
Don't worry about it - we've all been there!
When I replied, it was more to show you the calculation of the dates and a response to your question about drawing lines, boxes etc.  So for speed, I simply populated the table that the combobox is based on using SQLITESTUDIO rather than MVD (which is why there is nothing to see)!
As this has perhaps added a degree of confusion, I've re-done it wholly within MVD which will enable you to now see where you maintain your RAIT, ICT and whatever categories.  And because I've done it 'properly' this time (LOL!), rather than hard code the number of days into the script, you can set this as part of creating your categories.
Have a look at the example and I think it will become clearer.
Derek.

Post's attachments

Attachment icon snapper dates 3.zip 340.09 kb, 401 downloads since 2016-10-31 

Re: Field calculation and Drawing Lines query

Hi Derek,

Yep, that makes it clear how it works.

I have another query if you don't mind?. I have a grid on my a client form that displays some data from the package of care form where the dropdown with rait and ict are. That is one of the headers that I am trying to show in the grid on my client form but it is the only header that does not show any details from the query. Do you have any suggestions?

Thx,

John

Re: Field calculation and Drawing Lines query

Hi John,
From what you are saying, I suspect it's one of a couple of things.  Rather than guess (and get it wrong and therefore just cause confusion!), can you upload your project and /or take a couple of screen shots and annotate where the problem is.
Derek.

8 (edited by snapper1969 2016-11-10 13:52:35)

Re: Field calculation and Drawing Lines query

Hi Derek,

Sorry for the delay as I've been away. I managed tom fix the problem above but I was wondering if you could look at the attached. It's a very basic start to my database and I have a problem. On the invoices tab, if I edit an invoice it is supposed to go to the invoices form and show the relevant details but the invoices for is blanks. The invoice details grid at the bottom is populated but not the main form. If you go to it via the packages form it popultes ok and I can't work it out. Could you have a look if you don't mind and advise?

Thx,

John

Post's attachments

Attachment icon Commissioning Care.zip 361.45 kb, 364 downloads since 2016-11-10 

Re: Field calculation and Drawing Lines query

Hi John,
On your frmmain.gridinvoices, you specify packageofcare as your table;  I think this should be invoices.  You then need to add the packageofcare.id onto the grid so that it can link through to pick up the client details (see attached).
On a quick 2 minute glance, there are actually a few things that jump out as possible problems (eg, there is no relationship on the invoicedetails table up to the invoices table, invoices that don't belong to any client, packages of care that don't belong to any client etc etc), and I think (not 100% sure without checking it) that when you add a bit more test data, you might find you'll get issues with data being displayed more than once on some of your forms. 
But you may be aware of these already.
Derek.

Post's attachments

Attachment icon Commissioning Care.zip 361.63 kb, 381 downloads since 2016-11-10