1

(0 replies, posted in General)

Good evening community.

Hope that you are all feeling well.

I've been away for a long time but hoping to hang around more often.

I found some free time and returned to the MVD and created a sample of the settings form with a few ideas and hope that you'll find it useful.

Greetings,
Tommy.

2

(2 replies, posted in General)

@Sparrow,

Thank you very much for your help.

Very good example and useful.

3

(2 replies, posted in General)

Good evening everyone,

Hope that you are all doing well. I've found a very interesting topic where you can select multiple images on open dialog window:

http://myvisualdatabase.com/forum/viewtopic.php?id=3474

but I was wondering if this can work with selecting multiple files using DBFile component (files mostly pdf, word, excel, text, etc.) instead. I've tried to change the script a bit but no success.
Is it possible to make it working? Any help would be really appreciated.

Hello Derek,

Oh I see. Yes, you're right is much better option. Thank you for providing me this concept. I'll make sure to put it in good use big_smile
Still have much to learn.

Enjoy the weekend,
Tommy.

Sorry My bad I didn't saw that the serialnumber was a real and not text.
I have no excuse sad

Hello everyone once again,

This time I have a real nightmare. I tried to finally start with my final project but there's a huge gap that needs to be filled. Since we have machines with unique serial numbers that contains numbers and letters, I want to prevent being duplicating while saving the record. But so far I couldn't achieve it.
I found numerous articles and samples and tried to customize the codes and scripts to my project but still nothing.
One that somehow worked is that Derek put on the Duplicate sample, until I close the project and reopen it and then idk something went wrong and it's not working again. It stores the serial number as 0 when serial number contains letters but with numeric is working fine.
I send a sample, any help really appreciated.

7

(5 replies, posted in General)

Good afternoon everybody,

First of all I want to apologize for my "annoying" and constant posting with probably silly questions. I try to understand the logic that works with this magnificent application; it really rocks, and until I finally figure out the (to be honest my son found it accidentally lol ) I waste everybody's time. He (my son) download an invoice example and there was the answer that I was looking for sad

Derek I cannot count how many times you solved my problems and once again you show me exactly what I was searching for plus you gave me a
huge idea of how to adjust another part of my main project. Once it will be finished I'll publish it for everyone.

Thank you once again.

8

(5 replies, posted in General)

Thank you Sparrow.

I'll check it.

9

(5 replies, posted in General)

Good Evening everyone,

I was trying to figure out which is the correct procedure or way using MVD components to relate two tables with many to many relationship?
Firstly I was thinking about using tablegrid but I don't know if it's the correct way. Then I add another form with the two comboboxes and make them store the info (example, I want to relate printers with its consumables, because 1 printer has many consumables and one consumable is compatible with many models).

Also is there any way to use something like subform? Or tablegrid as subform?

I attach the sample to make it easier to understand what I want to achieve. (I know it's a mess but hopefully I did something right big_smile )
As you can imagine I'm freshman with less knowledge of how to use the MVD properly.

Thank you for any help.

10

(5 replies, posted in General)

Hello everyone and thank you for all your help.

Sparrow, yes I did this as you mentioned and I created this based on a template from countries and cities replacing the actual tables with a different names and keeping the format and settings.
Vladimir your code was what I had in mind and I tried that as well but for some reason I was experiencing an unusual error. And thanks to both of you I found where was the problem. The issue was on a grid that was on a second form that was creating a bug and creating ghost entries. Once I deleted it and wiped out all data and re enter the data everything was working like charm.

Thank you for all your help.

11

(5 replies, posted in General)

Hello once again,

I attach a sample of my project where I want to collect calls based on a customer and an administrator that gives the call from the customer. Although I connected both of the combobox1 (corresponds to customers) and combobox2 (corresponds to administrators that are related to the customers) and (hopefully created correctly the relationships between those tables), the combobox2 is empty at calls form no matter which customer I'm picking. I made all the checkups and make sure that the customers are connected with its corresponding administrator but for some reason it's not working.

Thank you for any help.

Hello Derek,

You are right I should have attach the sample project, but for yet another time you gave me the answer with the autofill A sample. That's exactly what I was looking for by using SQL command but I hadn't manage to find the correct expression.

Hope that I won't  bother you more with my annoying questions ha ha ha.

Have a goodnight.

Tommy.

Derek good afternoon,

Hope you're all fine and healthy.
Sorry for the delayed replay but due to an illness I had to rest for a week. But now I've returned full of energy.

You've just solved the problem once again and I cannot find the words to thank you.
It's exactly what I was looking for.

There's one thought that crossed my mind that I used to do when I was creating my first database on MS Access is that when you select an item from the combobox then it would autofill the textboxes based on a Query (i.e. customer name, address, etc.)  with the rest of the information. I hope that I state it clear for you to understand.
I checked the in settings if there is any available option for it but I couldn't find it. I don't know if this will work without using script and if it is hard to do than don't bother yourself, you have already helped me a lot. It's just an idea nothing more.

Thank you once again.
Enjoy the weekend.

Good morning everyone and thank you for your answers.

As you can imagine I've just started the programming and every start is difficult, so I try to experiment with different stuff to obtain experience. I try to ask for help only in a situations that I'm cornered and I'm grateful for every help.
derek thanks once again for your explanation and your tips at thinking of how to solve the problems. Your example is great and it helped me figure it out on my other problem that I had. But this time maybe I was not mentioned clearly what was my idea and if it is a pain to create id I'll just use a simple checkbox and won't disturb anyone else.
So what I want to do is based on the machine type that correspond to a model I want to hide fields at another form. I thought that by using a combobox and the value that is used to store when adding a record to a table should work but then I noticed that it didn't because it has to read not the combobox value but the modeltype_id based on a model that is attached to. So the code should be something like:

if form1.tablegrid.columnname.id = 1 then form2.edit1.visible := false;

but as I mentioned earlier I'm novice and hasn't fully update my knowledge of programming haha.

Thank you in advance once again.

Good evening,

I'm scratching my head over one bit tricky problem that I'm facing these days.
I've tried numerous solutions but I didn't manage to find a correct way.

So first things first we have 3 tables (models, modeltypes, meters) and 3 different forms. Now what I want to do is when a combobox on form 3 (meters) which is for the model name that has a specific model type changes based on the selection, I want to hide a specific field(s) on form 3, i.e. if the modeltype is black and white then hide the field on form 3.

I attach a sample project to be more helpful.
(It contains another forms and tables I was experimenting, but the forms that I want to work are form4, form5 and form6)

Thank you for any advice and help anyone can provide.

16

(5 replies, posted in Script)

Good Evening everyone,

I would like to share with you a dynamic menu script. I've tested it and it's working like a charm.
I also attached a sample.

Hope you enjoy it.

17

(2 replies, posted in General)

Hello Derek,

Once again you're the chosen one that make miracle. That's exactly what I was looking for!!

I don't know how to thank you.
Thanks a million!!!

18

(2 replies, posted in General)

Hello once again,

I've achieved many things thanks to your software. I'm almost done with my project but there's one thing that I cannot make it happen no matter what.
We have two different tables (lets call them table1 and table2) and they both have two fields (CURRENCY) field1.table1 and field2.table2 and I want them to show the totals (which I did in a tablegrid1 of table1 and tablegrid2 of table2) but what I want to do is to show in a separate or text field or label the subtraction of (sum of field1.table1) - (sum of field2.table2).

Thank you for your help in advance.

19

(7 replies, posted in Script)

Good evening derek,

Ha ha ha ha. Not to worry, I'm confused with you as well many times (customers-clients, our company stuff,etc.).
Well to be honest, the ability to switch users is more, how can I say, efficient and time saver because every user sees a different menu (buttons, forms, etc.) and instead of closing the application and reopen it to switch the user it would be easier just to logout. This will make the login form open. I'll try to write script that will automatically log out user after few minutes of inactivity (yes maybe it sounds crazy but I want to have an extra caution). Another fact is that our engineers mostly shares pcs and every user has its own desktop and sees different shared folders in network so I wanted to create something similar.

Thank you for your attached sample. It's a life saver to me. Thanks a million.

20

(7 replies, posted in Script)

Thank you for your replies.

That's what I was thinking to make changes to the user authorities without the need of closing the application, but I found something else which also is useful at least in my situation.
I've disabled the main menu options that are shown in the main form (form1) by default using the code I've found posted in another article:

Form1.mniFile.Visible := False;
Form1.mniOptions.Visible := False;
Form1.mniAbout.Visible := False;
Form1.mniReport.Visible := False;

and create a checkbox item that is visible only to the administrator and whenever it is checked it changes the menu visibility to true and show all the options again and modify whatever I want to and by unchecking it, it returns to the custom menu that I created. This is the code that I used maybe someone else will need it:

procedure Form1_CheckBox1_OnClick (Sender: TObject);

begin

If Form1.CheckBox1.Checked Then
begin
   Form1.mniFile.Visible := True;
   Form1.mniOptions.Visible := True;
   Form1.mniAbout.Visible := True;
   Form1.mniReport.Visible := True;
end
Else
  begin
   Form1.mniFile.Visible := False;
   Form1.mniOptions.Visible := False;
   Form1.mniAbout.Visible := False;
   Form1.mniReport.Visible := False;
   end
end;

I was wondering if you can create dynamic submenu items. I found some codes from another sites but they don't work for some reason. Anyway I attach photo of how do I imagine the menu.

Thank all of you for your help once again.

21

(7 replies, posted in Script)

Hello derek and thanks for your response,

I found this application very simple and easy to use and I wanted to keep tracking of our company's repair center. And as you mentioned correctly, we are using the user-role control system so not everyone can have administrator's rights.
Although I make a backup almost every day but I just wanted to have an alternative login system instead of closing the whole application to just switch users (we have viewer to see only the records, moderator to insert data and admin to create and design)
But if this is pain to make it happen I'll find another alternative.

Thank you once again.

22

(7 replies, posted in Script)

Hello everyone,

I'm trying to create a simple logout button but I cannot find the actual login form.

Any help?

Thank you.