A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

add textbox information to the table data and get it in



 
 
Thread Tools Display Modes
  #1  
Old July 5th, 2004, 10:54 AM
stilets
external usenet poster
 
Posts: n/a
Default 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  
Old July 5th, 2004, 07:41 PM
Steve Schapel
external usenet poster
 
Posts: n/a
Default 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  
Old July 6th, 2004, 09:12 AM
stilets
external usenet poster
 
Posts: n/a
Default 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  
Old July 6th, 2004, 10:07 AM
Steve Schapel
external usenet poster
 
Posts: n/a
Default 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  
Old July 6th, 2004, 12:54 PM
stilets
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.