1

Topic: Dynamic request

All greetings.
I will try to explain a problem essence.
There is a general table where the data for documents is stored. Also there is a second table where what columns are specified it is necessary for  for one document type (let it will be called [Doc_Colums]. More low an example from it)
The user should on the form in "a field with the list" select document type and push the button. After it should be deduced the table with strict the columns which are specified in the table [Doc_Colums]. (Also it was possible to edit fields)
How it is possible so to implement dynamic request?
It turns out if to select document  should deduce 4 columns.
Example of filling of the table [Doc_Colums]:

 DocName Columns
----------------------------
 DocNum
 DocDate
 Account
 Note
. Date_DTZ
. DocID
. DocNum
. DocDate 

Such document types now 18, also will grow. So a variant with creation for each document type to create the form - disappears.

2

Re: Dynamic request

Not clearly. At what here dynamic request? The tape form is deduced. In one field a parameter title. In other its value. Here also work with them.

3

Re: Dynamic request

And a problem in what? The request text to construct? Columns in  to add?

Devil_FoX wrote:

if to select document  should deduce 4 columns

SELECT Columns
FROM Doc_Colums
WHERE DocName = ""
strSQL = ""
With rs
.MoveFirst
Do Until.EOF
strSQL = "," AND strSQL AND! Columns
.MoveNext
Loop
End With
strSQL = "SELECT" AND Mid (strSQL, 3) AND "FROM Documents WHERE DocType = ' TTH '"

4

Re: Dynamic request

If it is a little variants (2-4) that create the form with group of switches in title and depending on value of group open, in the container of the subordinate form one of beforehand created as it is necessary to you

5

Re: Dynamic request

Devil_FoX wrote:

So a variant with creation for each document type to create the form - disappears.

"dynamic request" you are going to use This as a source of the general-purpose form? I correctly understood?
In this case to you anyway to hide/show elements on the form, and also, possibly, to change their coordinates. And in request-source it is better to deduce all fields from the table, the trouble with an otvjazkoj/binding of elements of the form to source fields differently will be added.

6

Re: Dynamic request

Devil_FoX wrote:

.... Such document types now 18, also will grow . So a variant with creation for each document type to create the form - disappears.

Successes in creation of "the dynamic form" smile))
And can frown and think over DB structure (storage and data handling, demarcation of the rights and .)

7

Re: Dynamic request

Joss wrote:

the tape form Is deduced.

That I did not understand that as  the form helps.

8

Re: Dynamic request

Akina wrote:

SELECT Columns
FROM Doc_Colums
WHERE DocName = ""
strSQL = ""
With rs
.MoveFirst
Do Until.EOF
strSQL = "," AND strSQL AND! Columns
.MoveNext
Loop
End With
strSQL = "SELECT" AND Mid (strSQL, 3) AND "FROM Documents WHERE DocType = ' TTH '"

Very similar on that that is necessary for me. I badly know VBA.
The first request needs to be written down in parameter or both requests in a tandem will already work?
To write down in a macro/module, and then it to hang up on start at button click?
If at me the document type undertakes from a field from the list as in WHERE it is possible to write down a condition?
The list - Forms! [Production]! [__]

9

Re: Dynamic request

Devil_FoX wrote:

the First request needs to be written down in parameter or both requests in a tandem will already work?

the First is a text of request. The second - the handling code , the request opened under the text. The total - the text of request which tiresomely to open as  or   as data source.

10

Re: Dynamic request

sdku wrote:

Successes in creation of "the dynamic form" smile))
And can frown and think over DB structure (storage and data handling, demarcation of the rights and .)

Well thanks. I and so wrinkle a forehead, after all I specialize on MS SQL and C#. And here the job - is necessary only in Access - and here for me all through...
In general I get out and I comprehend the new.

11

Re: Dynamic request

Devil_FoX wrote:

it is passed...
That I did not understand that as  the form helps.

it is elementary, Watson! (
Truth here it is still curled from the correct structure of a DB. There is at you a table in which two columns (roughly) Name of parameter and Value of parameter. The second table as two columns (besides roughly) Name of the document and a parameter Name. Create request from two tables with communication by name parameter. Do selection by name the document. Here to you and the Tape form with parameters and their values for each document.

12

Re: Dynamic request

Akina wrote:

the First is a text of request. The second - the handling code , the request opened under the text. The total - the text of request which tiresomely to open as  or   as data source.

I apologize. I badly understand. Can explain as all to make?

13

Re: Dynamic request

Devil_FoX wrote:

I and so I wrinkle a forehead, after all I specialize on MS SQL and C#. And here the job - is necessary only in Access - and here for me all through...

a DBMS - everywhere a DBMS. ADO - everywhere ADO. Well a bit different syntax... So "all through..." Is not the fact such, and a spirit such. And with it a horse-radish at you it does not turn out.

14

Re: Dynamic request

Just about. Without knowing structure of your DB it is necessary to dream only. And if at you the data confidential it is possible to correct them so that it was shone nothing. To Remove the superfluous. And so on your question it is possible to guess only.
Can is easier is valid to make under the form for each document?

15

Re: Dynamic request

Joss wrote:

without knowing structure of your DB it is necessary to dream only

I can not lay out. Archive 2 MB. And the site allows only 150 .

16

Re: Dynamic request

Is . Some spread Yandex-disk. There would be a desire.

17

Re: Dynamic request

Devil_FoX wrote:

I can not lay out. The archive 2 MB

And  all superfluous (including and one million records - steams of tens is enough) and to compress a DB - not?

18

Re: Dynamic request

Devil_FoX;
To create one dynamic form on 20 different variants of input a nonsense.
Imagine the shop trading in matches, cars and planes...
As I understand, you want  creation of new documents with new titles of fields.
I think that you simply should create one form with fields Pole1, Pole2, Pole3....
Further, in dynamic request to the form (on method Akina)  titles of fields under form fields.
Even it is possible to be perverted and dynamic to substitute titles of fields in shape.
- so did.