sparrow wrote:

Hi,
Your database does not contain records. The request returns NULL.
This can be avoided by using IFNULL in the query.

frmProd_Add.txtProdCode.Text := IntToStr(SQLExecute('SELECT IFNULL(MAX(id),0) + 1 FROM Products'));

Hi Sparrow,

thanks for the  response.

i already changed my syntax it works.

but how can i put the prefix "P" to on the id number that will end up like this "P0001"

thanks again

Here is my practice file of my inventory...

Thanks in advance

Hi everyone,

I'm trying to insert a product code on each item of my product..  When i click the add button it will go new form and will display prodcode that is available.

i newbie to write a script ...

i tried this script i code but it has error i don't know how to fix it.

procedure frmProd_Add_OnShow (Sender: TObject; Action: string);
begin
            frmProd_Add.txtProdCode.Text:= inttostr(sqlexecute('select max(id) from Products') + 1);

end;

Hope you can guide

thanks in advance...

29

(8 replies, posted in General)

Hi JB and joshuA,

Thanks for the information.

30

(8 replies, posted in General)

hi everyone,

i saw this "table dictionary" what is the use of this i'm just curious.

thanks in advance.

31

(16 replies, posted in FAQ)

derek wrote:

Hi John, Salut JB,
Try it like this.
Look at line 48 in the script (ignore everything else in the attachment as I just grabbed the nearest program to hand as an example).
I've put the next available ID on a label but you could use anything.
Regards,
Derek.


Hi Derek,

I saw the file you shared. I can use this as my guide in putting  itemcode in every product on my practice program (inventory).

I still need to learn basic script in MVD.

thanks derek.

32

(2 replies, posted in General)

Hi Derek,

Thanks again... I deleted my  db coz it needs to check the "not null" or otherwise I need to enter a value in the default value.

33

(16 replies, posted in FAQ)

jean.brezhonek wrote:

Hello John, Hi Derek

You have many ways to always get what you want (dixit Mixk Jagger)

Pour compter le nombre de lignes d'une grille

procedure Grille_OnShow (Sender: string; Action: string);
Var i : Integer;
begin
     Grille.TableGrid1.dbUpdate;
    i := Grille.TableGrid1.RowCount;
    Grille.Label1.Caption := 'Il y a ' + IntToStr(i) + ' fiches dans la table Biblio';
end;


Or

procedure Form1_TableGrid1_OnChange (Sender: string; ACol, ARow: Integer);
var s: string;
begin
s := IntToStr (SQLExecute('SELECT count(id) FROM base') );
Form1.Label1.Caption:= ' Total : ' + s;
end;

Or

procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
    Form1.Label1.Caption := IntToStr(Form1.TableGrid1.RowCount);
end;

JB


Hi JB,

i'm curious on how do you this in MVD do  you have a sample file on how it works..

thanks

34

(2 replies, posted in General)

Hi Everyone,

How do you do in MVD the text filter.  if the user forget to enter a data in the textbox and it will prompt the user to fill up the textbox.

i checked the "notify the user....." but it saves my record empty  it should prompt me.

thanks in advance.

35

(9 replies, posted in General)

Hi sparrow and Derek,


This is now working thanks for the help.

I appreciated your efforts.

I changed my script query.

Thanks again

36

(9 replies, posted in General)

sparrow wrote:

Hi Derek.


Lemodizon,
change query in script

('SELECT ProdQtty FROM Products WHERE Products.id= '+frmStockOut_Addprod.cboProd.sqlValue+ ' ')

about Script:  http://myvisualdatabase.com/help_en/Pascallanguage.html


Hi sparrow,

I already tried to changed query still it has error.

thanks for the link.

37

(9 replies, posted in General)

derek wrote:

Hi Lemodizon,
To automatically select a product, use the 'incremental search' property of the combobox (see the screenshot.jpg in the attachment).
Derek.


Hi Derek,

Thanks for the file....  i learned the use "Incremental search" still  i can't figure out the script query  from my combobox to display the price and current quantity.

thanks again

38

(9 replies, posted in General)

Hi Everyone,

This is my practice program in MVD. I'm trying the combobox. where i select the product name from the combobox it will automatic display the current quantity & price.

hope you can guide me.

thanks in advance

39

(9 replies, posted in General)

sparrow wrote:

Hi

As a rule, the data is displayed in a table.
In the attached file, an example where your question and output in the table.


Hi sparrow,

I tried your code it work when i choose the product name from the combobox  but it has error "no such column"  i think the relationship of my two tables.

40

(16 replies, posted in FAQ)

Hi k245,

Thanks for the information.

41

(9 replies, posted in General)

Hi sparrow,

thanks for the sample file (comboBox). I will try it. so i can be familiar on how to write & learn a script on MVD.

Hi Everyone,

Just want to ask on how do you script in MVD when i select the product name from my combobox it will automatic displayed the price and the current qtty on that product. I already linked my combobox to the table products and i was able to see the list of products.

or do you have sample project so i can check and learn on how things works.

thanks.

43

(16 replies, posted in FAQ)

Hi JB,

Thanks for the information, hope Dmitry I.... will come back and add more features on MVD.. I find MVD a great software.

what type of programming language is MVD or is this a programming language? or RDBMS software?

Hope MVD can help me on creating my inventory.

Thanks JB.

Hi JB,

Thanks for the clue. it works.

my question is do i have to change the syntax in the procedure part "String" coz the original is "ToObject" i changed it to "String"

in the last part of the script is this part of syntax

begin
end.

looks like end of the whole program?

procedure CalculateTotal;
begin
    Form1.edTotal.Value := Form1.edCost.Value * Form1.edQ.Value;                  // We perform the calculation
end;

looks like a function or method i'm not sure.


how do you fliter the text field in the MDV if the user forget to enter a data.?

is there a if else condition in MDV.


Sorry for my questions coz i don't have any idea on how MVD scripts works.

Thanks JB

Hello everyone,

I'm newbie in MDV. i created a simple form and try MDV, my question is how can i calculate the two fields in my form.


amount = Qtty * Unit cost

once the user entered the qtty and unit cost it will automatic display the amount.

hope you can help me.

thanks in advance.

46

(16 replies, posted in FAQ)

Hi Derek,

Thanks again.. Do you know who is the founder/ceo of "my visual database". i was trying to search when is MDV started.

I was exploring yesterday the MDV.  it is a great application.

47

(16 replies, posted in FAQ)

Hi derek,

thanks for the link.

48

(16 replies, posted in FAQ)

Hi everyone,

I'm new here in this forum.. just want to ask if there is a  tutorial site, books on how to use MVD? i'm kinda curious in the script part I don't what is the function of the script part in the MVD.

I'm planning to create a simple inventory application hope i can create using MVD.

Thanks everyone.