If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
add textbox information to the table data and get it in
let's say i have such a structure for a table:
| year | product | amount | i have a form, using text box'es like this: year product amount product amount .... product amount (some of textbox'es (products and amounts) can be empty.) i want to add these data to the table. how can it be done? :::::: part 2 ::::::::: is it possible to get data from the table using similar form so that - when the user chooses a year, all the textbox'es are filled with the products and amounts of the year? |
#2
|
|||
|
|||
add textbox information to the table data and get it in
Stilets,
If you look at the Properties of the form, you will see a property called Default View. If you set this to Continuous Forms, you will be able to see multiple records listed in the kind of layout that you describe. Just to clarify your meaning, you should only have one textbox for product and one textbox for amount in the design of your form. If you put an *unbound* textbox in the Form Header section, let's say you name it YearSelector, and then make a query based on your table, and make this query the Record Source of your form, you can refer to this textbox in the Criteria of the Year field in the query, like this... Nz([Forms]![NameOfYourForm]![YearSelector],"*") .... so then when you enter a year in the YearSelector textbox, only the records for that year will be shown in the form. As a complete side issue, the word "year" is a Reserved Word (has a special meaning) in Access, and as such it is not a good idea to use it as the name of a field or control. -- Steve Schapel, Microsoft Access MVP stilets wrote: let's say i have such a structure for a table: | year | product | amount | i have a form, using text box'es like this: year product amount product amount ... product amount (some of textbox'es (products and amounts) can be empty.) i want to add these data to the table. how can it be done? :::::: part 2 ::::::::: is it possible to get data from the table using similar form so that - when the user chooses a year, all the textbox'es are filled with the products and amounts of the year? |
#3
|
|||
|
|||
add textbox information to the table data and get it in
It seems to be the right solution. Thank you!
But - how can I make the query update and put on the form only the necessary records? (I have all the records (not the records of the selected year).) "Steve Schapel" wrote: Stilets, If you look at the Properties of the form, you will see a property called Default View. If you set this to Continuous Forms, you will be able to see multiple records listed in the kind of layout that you describe. Just to clarify your meaning, you should only have one textbox for product and one textbox for amount in the design of your form. If you put an *unbound* textbox in the Form Header section, let's say you name it YearSelector, and then make a query based on your table, and make this query the Record Source of your form, you can refer to this textbox in the Criteria of the Year field in the query, like this... Nz([Forms]![NameOfYourForm]![YearSelector],"*") .... so then when you enter a year in the YearSelector textbox, only the records for that year will be shown in the form. As a complete side issue, the word "year" is a Reserved Word (has a special meaning) in Access, and as such it is not a good idea to use it as the name of a field or control. -- Steve Schapel, Microsoft Access MVP stilets wrote: let's say i have such a structure for a table: | year | product | amount | i have a form, using text box'es like this: year product amount product amount ... product amount (some of textbox'es (products and amounts) can be empty.) i want to add these data to the table. how can it be done? :::::: part 2 ::::::::: is it possible to get data from the table using similar form so that - when the user chooses a year, all the textbox'es are filled with the products and amounts of the year? |
#4
|
|||
|
|||
add textbox information to the table data and get it in
Stilets,
You might need to put soem code like this... Me.Requery .... on the AfterUpdate event of the YearSelector textbox. -- Steve Schapel, Microsoft Access MVP stilets wrote: It seems to be the right solution. Thank you! But - how can I make the query update and put on the form only the necessary records? (I have all the records (not the records of the selected year).) |
#5
|
|||
|
|||
add textbox information to the table data and get it in
It works! Thank you!
"Steve Schapel" wrote: Stilets, You might need to put soem code like this... Me.Requery .... on the AfterUpdate event of the YearSelector textbox. -- Steve Schapel, Microsoft Access MVP stilets wrote: It seems to be the right solution. Thank you! But - how can I make the query update and put on the form only the necessary records? (I have all the records (not the records of the selected year).) |
Thread Tools | |
Display Modes | |
|
|