Hi all.
Sorry for long explanation of my problem, but I can't explain it shorter. I have started to use Alpha Five V9 Platinum a month ago.
Suppose I have SLQ table named ARTICLES, say in FIREBIRD database. It is a table in which I intend to save articles for several firms, in which every firm has its own list of articles. Simplified, this table have next structure:
ARTICLEID Numeric This is ID for article row
FIRMID Numeric This is ID of firm which are articles
ARTICLENAME Character This is article for FIRMID
I decided to make application with data of several firms in one database, and I can,t change that because it is important for my users.
In the begining of application I have a form for loging in user and then another form with browse for selecting firm. After that form with browse I have value for FIRMID of selected firm, which I put in GLOBAL variable glFIRMID. Next I open third form with many buttons for working with selected firm's data. One of them is intended for opening form for entering articles for selected firm.
After that I created Active Link Table based on ARTICLES table. During creation process I formed SELECT statement: SELECT * FROM ARTICLES WHERE FIRMID = :argFIRMID. Also, Alpha formed INSERT statement: INSERT INTO ARTICLES (ARTICLEID,FIRMID,ARTICLENAME) VALUES (:new.ARTICLEID,:new.FIRMID,:new.ARTICLENAME).
When I click on mentioned button I get dialog box prompting me for value for argument argFIRMID. Well, as I already have that value in glFIRMID variable, I would like not to get that prompt but to transfer my global variable value to SELECT statement as value for argument. I read some messages and texts about SQL::Arguments but did not succeded. I tried several combinations but without result. Now I do not know how to do that (what code to write) and where (in what event of what object) to put that code.
Same thing is with INSERT statement. Can I write that statement with :glFIRMID instead :new.FIRMID ? How to pass glFIRMID to INSERT statement ?
This is big step for me but I am totally stoped, I can't go further. I will have many other tables with same problem.
Thank you in advance.
Dordije.
Sorry for long explanation of my problem, but I can't explain it shorter. I have started to use Alpha Five V9 Platinum a month ago.
Suppose I have SLQ table named ARTICLES, say in FIREBIRD database. It is a table in which I intend to save articles for several firms, in which every firm has its own list of articles. Simplified, this table have next structure:
ARTICLEID Numeric This is ID for article row
FIRMID Numeric This is ID of firm which are articles
ARTICLENAME Character This is article for FIRMID
I decided to make application with data of several firms in one database, and I can,t change that because it is important for my users.
In the begining of application I have a form for loging in user and then another form with browse for selecting firm. After that form with browse I have value for FIRMID of selected firm, which I put in GLOBAL variable glFIRMID. Next I open third form with many buttons for working with selected firm's data. One of them is intended for opening form for entering articles for selected firm.
After that I created Active Link Table based on ARTICLES table. During creation process I formed SELECT statement: SELECT * FROM ARTICLES WHERE FIRMID = :argFIRMID. Also, Alpha formed INSERT statement: INSERT INTO ARTICLES (ARTICLEID,FIRMID,ARTICLENAME) VALUES (:new.ARTICLEID,:new.FIRMID,:new.ARTICLENAME).
When I click on mentioned button I get dialog box prompting me for value for argument argFIRMID. Well, as I already have that value in glFIRMID variable, I would like not to get that prompt but to transfer my global variable value to SELECT statement as value for argument. I read some messages and texts about SQL::Arguments but did not succeded. I tried several combinations but without result. Now I do not know how to do that (what code to write) and where (in what event of what object) to put that code.
Same thing is with INSERT statement. Can I write that statement with :glFIRMID instead :new.FIRMID ? How to pass glFIRMID to INSERT statement ?
This is big step for me but I am totally stoped, I can't go further. I will have many other tables with same problem.
Thank you in advance.
Dordije.
Comment