201

(17 replies, posted in General)

Project revised. Date labels only show the most recent date of the task.

202

(17 replies, posted in General)

leprince2007,
I reworked your project and hopefully I am a little closer to what you want. Since I did not have answers to my questions, I had to make some assumptions especially as it relates to Question 4 when selecting a prior date.


There is only one form to do all updating of date records. It required a little scripting because it is a little out of the ordinary for MVD, but it shows the power of MVD to be able to do most anything you want. The script will automatically place the form in the mode it needs to either ADD or SHOW a record based on the date selected at the top of the form. The one thing that may be questionable is what label dates to show when selecting a prior date record. What the script does is show the most recent dates of the tasks based on the selected date at the top of the form. If that is not what you want, it is easy enough to change. You just have to let me know which way you want.


No FOR LOOP is necessary as in your VB project. A simple SQL SELECT can directly access the most recent date record. Also, I'm not sure how you built the database structure. You must have done this outside of MVD because MVD requires the "id" autoincrement key field and it was missing in your database. I added it to your structure.

203

(17 replies, posted in General)

leprince2007, we will get you through this, but there a few things you should know about MVD and a few things we need to understand about your project. First, in the normal and elementary progression of MVD you would have a form with a tablegrid of your database records. This is what CDB was alluding to. For the sake of discussion we will call it Form1, but it can be any name you want. Then you would have a subsequent form to be able to add records and change records. We will call this Form2, but it can be any name you want.This form needs to know if it is in ShowRecord mode or NewRecord mode. Typically you would have a new button on the tablegrid form (Form1) which would open Form2 to enter a new record. MVD puts Form2 in NewRecord mode. Also in Form1 you would have buttons to edit and/or delete records in the tablegrid of database records. The edit button would open Form2 to change the record info. MVD puts Form2 in ShowRecord mode.This is the process in its elementary state. This is not an absolute way you have to do it, but it will require a little bit of scripting, which is not a big deal.

Question 1 - In your VB project did you have a tablegrid form to navigate to the update form you presented in your project in your post. If not, that's ok. We can still work with it.

Question 2 - If you did not have a tablegrid form and only used the one form to do all your adding and updating, then how did you retrieve the record you wanted? Did you use the date field at the top of the form to search for the corresponding date record?

Question 3 - What is the purpose of storing all your daily records? Is it to only retrieve the last date a task was performed? If that's the case, then eventually (after each task has been performed twice) you will have dead records in the database and will have no value to the application and wasting space.

Question 4 - If there is another reason for storing past records, then when you select a record , say a record from 6 months ago, what should show in each of the respective task date label displayed on the form. Is it the last date prior to the date displayed at the top? I'm not exactly sure what benefit this would have in your application to know this, but it's your app and it that's the way you want it, then so be it.


Let's start with these questions and see what we can do. Now having said that, I cannot guarantee you my time commitment to this. This is not my full time job, but I will try to help as much as I can. If Derek or CDB or anybody else would like to step in at any time, by all means do so.

204

(17 replies, posted in General)

leprince2007,
My apology for not fully understanding your requirements. It sounds like Derek's solution may be closer to what you want then. Try it out and see.

205

(1 replies, posted in General)

rufmersamlabag,
Why would you want to do that? It seems to me that you could damage the database integrity and show misleading results in your records if saved with an inappropriate combobox entry.

206

(17 replies, posted in General)

leprince2007 and Derek,
I was trying to get my hands around leprince2007's design for some of the same reasons you gave Derek. I made some assumptions which sometimes one has to do on some forum requests. Since he only wants to know the last date the task was performed and not necessarily wanting a history of the tasks and that one or more of these tasks are done daily, I made the assumption that the same task record is to be used. Using leprince2007's form design (and you are right Derek that a date needs to be defined for each checkbox and requires extra coding), I revised his project to show the last date the task was performed. Each day when the project is opened the checkboxes are all cleared for that day, but the dates remain until the task is performed (checked) again at which time the date is updated for that task. It's an option and not at all meant to be an end-all solution. Maybe the combination of the two is also a solution. At least it should give leprince2007 some ideas.

207

(10 replies, posted in General)

Ahhh….alphanumeric part number. Given the csv test file from v_pozidis, the assumption was that part numbers are numeric. Well as developers we all know what assumptions can do to us. LOL.

208

(10 replies, posted in General)

V_Pozidis, Derek,
Revised project is attached. I added the logic to check for the existence of a part number. If it does not exist then the part is inserted into the Part table. If it does exist then the qty in the csv file is added to the qty in the Part table.

209

(10 replies, posted in General)

How are you importing the Excel file? Is it via csv or reading the Excel worksheet directly through the OLE object? Can you attach your project?

210

(6 replies, posted in General)

MVD cannot do it. Here is the link to download Enigma Virtual Box as humblelion mentioned.
https://enigmaprotector.com/en/aboutvb.html

211

(4 replies, posted in General)

Here is the post I found.
http://myvisualdatabase.com/forum/viewt … 014#p27014

212

(17 replies, posted in General)

lupo1st,
It works fine for me in 6.3 Beta. Attach your project so people here can give assistance.

213

(2 replies, posted in General)

Adam,
I don't work with treeviews, but I'm assuming it's the same as tablegrids. Try doing the following:

If (Form1.TreeView4.RowCount > 0) and (Form1.TreeView4.SelectedRow = -1) then

214

(4 replies, posted in General)

You can use script to connect to MySQL and a form is not necessary. Here is a link to the post in this forum for the solution:
http://myvisualdatabase.com/forum/viewt … 276#p10276

215

(3 replies, posted in General)

Open up the report designer. Then simply replace the picture. See the attached on how to replace the logo in report designer.

216

(4 replies, posted in General)

Trim() function should take care of it.

217

(3 replies, posted in General)

chanthait,
Can you be a little more specific as to your request. If you are looking for an example of a simple invoice system, the MVD website has one. Here is the link:
http://myvisualdatabase.com/database_ex … oices.html

218

(7 replies, posted in General)

Scribtx,
Like Derek I could not replicate your problem/error. It would be much more helpful if you provided more specific information as to what you are doing. Describe what buttons you are clicking, etc.. Screenshots would be very helpful in describing the progression to the error.

219

(2 replies, posted in SQL queries)

Your project download link was not correct or active.


Did you include the id in your query? It must be in the SELECT statement. If you do not want to see the id in the tablegrid, then you can place the literal "delete_col" in the titles in the same position as id in the SELECT.

220

(6 replies, posted in General)

If you create a field outside of the pagecontrol and then subsequently drag the field inside the pagecontrol it will be there for all tabs because it technically is not part of the pagecontrol. So you basically have to delete and re-create the field OR cut and paste the field while the pagecontrol has focus.

221

(2 replies, posted in Script)

The simple answer is yes. If you want to import csv data from a single file into a single table, you can do it without script. If you want to import from Excel or csv file into multiple tables, then you will need to do it through script. There are examples on this forum on how to do it. If you need help with it, just post back here. I would provide examples right now for you, but I'm sort of busy with last minute Christmas things.

222

(6 replies, posted in General)

You simply write the appropriate SQL in the SELECT statement. You can place left joins and where clauses, etc in the SELECT statement as needed for additional tables.

223

(7 replies, posted in SQL queries)

vijaian77,
Welcome aboard. I think you are making things more complicated than they need to be. You can do the print without doing the ReportSql. You can do it with the Report Action and define what fields you want to include in the report (No SQL needed). You will need to format the report the way you want it in FastReport. Since you are using the grid and record form on one form. I added a couple of script lines to show the record fields when you click on a row in the GridClients.

224

(6 replies, posted in General)

blackpearl8534.
Here is another way:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    Form1.Tablegrid1.dbSQL:='SELECT id, lastname, firstname FROM employees'; 
    Form1.Tablegrid1.dbGeneralTable := 'employees'; 
    Form1.Tablegrid1.dbListFieldsNames :='delete_col,Last Name,First Name'; 
    Form1.Tablegrid1.dbSQLExecute;
end;

225

(1 replies, posted in General)

asawyer13,
Just saw your post and since nobody responded, I'll give you a possible solution. First, you cannot place buttons as defined in MVD inside tablegrids. However, you can place graphic images in the tablegrid rows. You can conditionally swap out images based on the content of a row. You will need to utilize your skills in a graphics program to create the various buttons you want to use.


Take a look at the attached project and see if it meets your needs. Just a forewarning, I did not spend any time creating high resolution button images so the buttons are not the greatest looking buttons. In my project I have a black button and a red button. The red button is displayed if Col2 is empty. The black button is displayed if Col2 is not empty. But you can change the condition to suit your needs.


Hope this helps.