By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

A couple of questions

P: n/a
Don
I'm not very proficient with Access, probably only enough to make me
dangerous. With that said I've got two questions.

#1 (probably pretty simple). I know I've done this before but how do I get
my forms to open to a "new" record each time?

#2 I'm trying to develop a list, a shopping list if you will. I have a
table with three columns. Let's say column one is "Item". Column two is
"Cost", and column three is a "check box".

The intent would be when you go shopping you check, in the "check box", the
items you want to buy. The cost column would total the items chosen. After
this I would just like to print the entire list.

Would it be best to create a form based on a query of the table? Then have
a report that would print the query?

I'm really stumped on how to accomplish this. I know it must be easier than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm really not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........
Aug 19 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
comments inline.

"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to make me
dangerous. With that said I've got two questions.

#1 (probably pretty simple). I know I've done this before but how do I
get
my forms to open to a "new" record each time?
if you don't want to be able to look at existing records in the form, just
set the form's DataEntry property to Yes.

if you *do* want to see existing records, then add the following code to the
form's OnLoad event, as

Private Sub Form_Load()

DoCmd.RunCommand acCmdRecordsGoToNew

End Sub

>
#2 I'm trying to develop a list, a shopping list if you will. I have a
table with three columns. Let's say column one is "Item". Column two is
"Cost", and column three is a "check box".

The intent would be when you go shopping you check, in the "check box",
the
items you want to buy. The cost column would total the items chosen.
After
this I would just like to print the entire list.

Would it be best to create a form based on a query of the table? Then
have
a report that would print the query?
you can just base your form on the table directly - no need for a query.

assuming that you don't need to preserve the selections you checkmark from
"shopping trip" to the next, suggest the following:

1. add a field to the table, called Quantity, and enter zero (0) in each
record.
2. rename the Cost field to Price, and make sure the data type of that field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard on the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name it txtCost,
and set its' ControlSource to

=Quantity*Price

6. in the form's Footer section, add another unbound textbox control, name
it txtTotal, and set its' ControlSource to

=Sum(Quantity*Price)

now as you enter quantities for each item you want to buy (leaving the zero
value for items you don't want to buy this time), you'll see the total cost
per product, and the total cost of your proposed shopping trip at the bottom
of the form.

7. add a button to the form, and call it cmdReset. add code to the button to
run an Update query that resets the Quantity field in the table to zero (0).
you can click the button after you print your shopping list, or when you
open the form to make a new list.

to print the list of items you selected: create a query based on the table.
in query design view, create a calculated field, as

Cost: Quantity*Price

add criteria to the Quantity field, as
0
you can use the AutoReport: Tabular wizard to quickly create a columnar
report, based on the query, that lists only the items for which you entered
quantities in the form. in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

hth

>
I'm really stumped on how to accomplish this. I know it must be easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm really not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........


Aug 19 '06 #2

P: n/a
Don
Thanks for your help. I've done everything except, I can't make the "Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.

"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to make me
dangerous. With that said I've got two questions.

#1 (probably pretty simple). I know I've done this before but how do I
get
my forms to open to a "new" record each time?

if you don't want to be able to look at existing records in the form, just
set the form's DataEntry property to Yes.

if you *do* want to see existing records, then add the following code to
the
form's OnLoad event, as

Private Sub Form_Load()

DoCmd.RunCommand acCmdRecordsGoToNew

End Sub


#2 I'm trying to develop a list, a shopping list if you will. I have a
table with three columns. Let's say column one is "Item". Column two
is
"Cost", and column three is a "check box".

The intent would be when you go shopping you check, in the "check box",
the
items you want to buy. The cost column would total the items chosen.
After
this I would just like to print the entire list.

Would it be best to create a form based on a query of the table? Then
have
a report that would print the query?

you can just base your form on the table directly - no need for a query.

assuming that you don't need to preserve the selections you checkmark from
"shopping trip" to the next, suggest the following:

1. add a field to the table, called Quantity, and enter zero (0) in each
record.
2. rename the Cost field to Price, and make sure the data type of that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard on the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name it
txtCost,
and set its' ControlSource to

=Quantity*Price

6. in the form's Footer section, add another unbound textbox control, name
it txtTotal, and set its' ControlSource to

=Sum(Quantity*Price)

now as you enter quantities for each item you want to buy (leaving the
zero
value for items you don't want to buy this time), you'll see the total
cost
per product, and the total cost of your proposed shopping trip at the
bottom
of the form.

7. add a button to the form, and call it cmdReset. add code to the button
to
run an Update query that resets the Quantity field in the table to zero
(0).
you can click the button after you print your shopping list, or when you
open the form to make a new list.

to print the list of items you selected: create a query based on the
table.
in query design view, create a calculated field, as

Cost: Quantity*Price

add criteria to the Quantity field, as
0

you can use the AutoReport: Tabular wizard to quickly create a columnar
report, based on the query, that lists only the items for which you
entered
quantities in the form. in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

hth


I'm really stumped on how to accomplish this. I know it must be easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm really
not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........


Aug 20 '06 #3

P: n/a
first, create an Update query to change the value of the Quantity field in
the table to zero (0); i'll call it qryUpdateToZero. add code to the command
button's Click event procedure, as

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateToZero"
DoCmd.SetWarnings True

if you don't know how to create an event procedure, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, for illustrated step-by-step instructions.

and btw, in the previous post, where i said
in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)
i should have specificed that the txtTotal textbox control should be placed
in the form's Footer section.

hth
"Don" <vz******@verizon.netwrote in message
news:yB_Fg.7591$u1.2655@trnddc05...
Thanks for your help. I've done everything except, I can't make the
"Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.

"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to make me
dangerous. With that said I've got two questions.
>
#1 (probably pretty simple). I know I've done this before but how do
I
get
my forms to open to a "new" record each time?
if you don't want to be able to look at existing records in the form,
just
set the form's DataEntry property to Yes.

if you *do* want to see existing records, then add the following code to
the
form's OnLoad event, as

Private Sub Form_Load()

DoCmd.RunCommand acCmdRecordsGoToNew

End Sub

>
#2 I'm trying to develop a list, a shopping list if you will. I have
a
table with three columns. Let's say column one is "Item". Column two
is
"Cost", and column three is a "check box".
>
The intent would be when you go shopping you check, in the "check
box",
the
items you want to buy. The cost column would total the items chosen.
After
this I would just like to print the entire list.
>
Would it be best to create a form based on a query of the table? Then
have
a report that would print the query?
you can just base your form on the table directly - no need for a query.

assuming that you don't need to preserve the selections you checkmark
from
"shopping trip" to the next, suggest the following:

1. add a field to the table, called Quantity, and enter zero (0) in each
record.
2. rename the Cost field to Price, and make sure the data type of that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard on
the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name it
txtCost,
and set its' ControlSource to

=Quantity*Price

6. in the form's Footer section, add another unbound textbox control,
name
it txtTotal, and set its' ControlSource to

=Sum(Quantity*Price)

now as you enter quantities for each item you want to buy (leaving the
zero
value for items you don't want to buy this time), you'll see the total
cost
per product, and the total cost of your proposed shopping trip at the
bottom
of the form.

7. add a button to the form, and call it cmdReset. add code to the
button
to
run an Update query that resets the Quantity field in the table to zero
(0).
you can click the button after you print your shopping list, or when you
open the form to make a new list.

to print the list of items you selected: create a query based on the
table.
in query design view, create a calculated field, as

Cost: Quantity*Price

add criteria to the Quantity field, as
0
you can use the AutoReport: Tabular wizard to quickly create a columnar
report, based on the query, that lists only the items for which you
entered
quantities in the form. in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

hth

>
I'm really stumped on how to accomplish this. I know it must be
easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm really
not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........
>
>


Aug 21 '06 #4

P: n/a
Don
Thanks again Tina,
I did understand where to put the text box, some things I get.
However on this button and update query control thing, is there something
about the query I'm missing?
When I click on the command button the "qryUpdateTo Zero" query opens up but
it doesn't reset anything.
I'm sure it's something simple I don't understand.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:MQ*********************@bgtnsc05-news.ops.worldnet.att.net...
first, create an Update query to change the value of the Quantity field in
the table to zero (0); i'll call it qryUpdateToZero. add code to the
command
button's Click event procedure, as

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateToZero"
DoCmd.SetWarnings True

if you don't know how to create an event procedure, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, for illustrated step-by-step instructions.

and btw, in the previous post, where i said
in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

i should have specificed that the txtTotal textbox control should be
placed
in the form's Footer section.

hth
"Don" <vz******@verizon.netwrote in message
news:yB_Fg.7591$u1.2655@trnddc05...
Thanks for your help. I've done everything except, I can't make the
"Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.
>
"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to make me
dangerous. With that said I've got two questions.

#1 (probably pretty simple). I know I've done this before but how
do
I
get
my forms to open to a "new" record each time?
>
if you don't want to be able to look at existing records in the form,
just
set the form's DataEntry property to Yes.
>
if you *do* want to see existing records, then add the following code
to
the
form's OnLoad event, as
>
Private Sub Form_Load()
>
DoCmd.RunCommand acCmdRecordsGoToNew
>
End Sub
>
>

#2 I'm trying to develop a list, a shopping list if you will. I
have
a
table with three columns. Let's say column one is "Item". Column
two
is
"Cost", and column three is a "check box".

The intent would be when you go shopping you check, in the "check
box",
the
items you want to buy. The cost column would total the items
chosen.
After
this I would just like to print the entire list.

Would it be best to create a form based on a query of the table?
Then
have
a report that would print the query?
>
you can just base your form on the table directly - no need for a
query.
>
assuming that you don't need to preserve the selections you checkmark
from
"shopping trip" to the next, suggest the following:
>
1. add a field to the table, called Quantity, and enter zero (0) in
each
record.
2. rename the Cost field to Price, and make sure the data type of that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard on
the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name it
txtCost,
and set its' ControlSource to
>
=Quantity*Price
>
6. in the form's Footer section, add another unbound textbox control,
name
it txtTotal, and set its' ControlSource to
>
=Sum(Quantity*Price)
>
now as you enter quantities for each item you want to buy (leaving the
zero
value for items you don't want to buy this time), you'll see the total
cost
per product, and the total cost of your proposed shopping trip at the
bottom
of the form.
>
7. add a button to the form, and call it cmdReset. add code to the
button
to
run an Update query that resets the Quantity field in the table to
zero
(0).
you can click the button after you print your shopping list, or when
you
open the form to make a new list.
>
to print the list of items you selected: create a query based on the
table.
in query design view, create a calculated field, as
>
Cost: Quantity*Price
>
add criteria to the Quantity field, as
>
0
>
you can use the AutoReport: Tabular wizard to quickly create a
columnar
report, based on the query, that lists only the items for which you
entered
quantities in the form. in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to
>
=Sum(Quantity*Price)
>
hth
>
>

I'm really stumped on how to accomplish this. I know it must be
easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm
really
not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........


>
>


Aug 21 '06 #5

P: n/a
When I click on the command button the "qryUpdateTo Zero" query opens up
but
it doesn't reset anything.
you've created a Select query, Don. you need to create an Update query. in
Access Help, do a search on Update Query and it'll tell you exactly how to
make one. if you have trouble with it, post back with specific questions.

hth
"Don" <vz******@verizon.netwrote in message
news:XveGg.19520$uV.18858@trnddc08...
Thanks again Tina,
I did understand where to put the text box, some things I get.
However on this button and update query control thing, is there something
about the query I'm missing?
When I click on the command button the "qryUpdateTo Zero" query opens up
but
it doesn't reset anything.
I'm sure it's something simple I don't understand.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:MQ*********************@bgtnsc05-news.ops.worldnet.att.net...
first, create an Update query to change the value of the Quantity field
in
the table to zero (0); i'll call it qryUpdateToZero. add code to the
command
button's Click event procedure, as

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateToZero"
DoCmd.SetWarnings True

if you don't know how to create an event procedure, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, for illustrated step-by-step instructions.

and btw, in the previous post, where i said
in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to
>
=Sum(Quantity*Price)
i should have specificed that the txtTotal textbox control should be
placed
in the form's Footer section.

hth
"Don" <vz******@verizon.netwrote in message
news:yB_Fg.7591$u1.2655@trnddc05...
Thanks for your help. I've done everything except, I can't make the
"Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.

"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to make
me
dangerous. With that said I've got two questions.
>
#1 (probably pretty simple). I know I've done this before but how
do
I
get
my forms to open to a "new" record each time?

if you don't want to be able to look at existing records in the
form,
just
set the form's DataEntry property to Yes.

if you *do* want to see existing records, then add the following
code
to
the
form's OnLoad event, as

Private Sub Form_Load()

DoCmd.RunCommand acCmdRecordsGoToNew

End Sub


>
#2 I'm trying to develop a list, a shopping list if you will. I
have
a
table with three columns. Let's say column one is "Item". Column
two
is
"Cost", and column three is a "check box".
>
The intent would be when you go shopping you check, in the "check
box",
the
items you want to buy. The cost column would total the items
chosen.
After
this I would just like to print the entire list.
>
Would it be best to create a form based on a query of the table?
Then
have
a report that would print the query?

you can just base your form on the table directly - no need for a
query.

assuming that you don't need to preserve the selections you
checkmark
from
"shopping trip" to the next, suggest the following:

1. add a field to the table, called Quantity, and enter zero (0) in
each
record.
2. rename the Cost field to Price, and make sure the data type of
that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard
on
the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name it
txtCost,
and set its' ControlSource to

=Quantity*Price

6. in the form's Footer section, add another unbound textbox
control,
name
it txtTotal, and set its' ControlSource to

=Sum(Quantity*Price)

now as you enter quantities for each item you want to buy (leaving
the
zero
value for items you don't want to buy this time), you'll see the
total
cost
per product, and the total cost of your proposed shopping trip at
the
bottom
of the form.

7. add a button to the form, and call it cmdReset. add code to the
button
to
run an Update query that resets the Quantity field in the table to
zero
(0).
you can click the button after you print your shopping list, or when
you
open the form to make a new list.

to print the list of items you selected: create a query based on
the
table.
in query design view, create a calculated field, as

Cost: Quantity*Price

add criteria to the Quantity field, as

0

you can use the AutoReport: Tabular wizard to quickly create a
columnar
report, based on the query, that lists only the items for which you
entered
quantities in the form. in report design view, add an unbound
textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

hth


>
I'm really stumped on how to accomplish this. I know it must be
easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm
really
not
very knowledgeable of MS Access, only enough to make me dangerous.
Thanks,
Don...........
>
>


>
>


Aug 21 '06 #6

P: n/a
Don
Tina,
Thanks for your help. I did get the update query to work. I never knew
about that kind of option, cool. It took a little bit of trial and error
until I understood how to make it work but I did get it.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:A%********************@bgtnsc04-news.ops.worldnet.att.net...
When I click on the command button the "qryUpdateTo Zero" query opens up
but
it doesn't reset anything.

you've created a Select query, Don. you need to create an Update query. in
Access Help, do a search on Update Query and it'll tell you exactly how to
make one. if you have trouble with it, post back with specific questions.

hth
"Don" <vz******@verizon.netwrote in message
news:XveGg.19520$uV.18858@trnddc08...
Thanks again Tina,
I did understand where to put the text box, some things I get.
However on this button and update query control thing, is there
something
about the query I'm missing?
When I click on the command button the "qryUpdateTo Zero" query opens up
but
it doesn't reset anything.
I'm sure it's something simple I don't understand.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:MQ*********************@bgtnsc05-news.ops.worldnet.att.net...
first, create an Update query to change the value of the Quantity
field
in
the table to zero (0); i'll call it qryUpdateToZero. add code to the
command
button's Click event procedure, as
>
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateToZero"
DoCmd.SetWarnings True
>
if you don't know how to create an event procedure, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, for illustrated step-by-step instructions.
>
and btw, in the previous post, where i said
>
in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)
>
i should have specificed that the txtTotal textbox control should be
placed
in the form's Footer section.
>
hth
>
>
"Don" <vz******@verizon.netwrote in message
news:yB_Fg.7591$u1.2655@trnddc05...
Thanks for your help. I've done everything except, I can't make the
"Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.
>
"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to
make
me
dangerous. With that said I've got two questions.

#1 (probably pretty simple). I know I've done this before but
how
do
I
get
my forms to open to a "new" record each time?
>
if you don't want to be able to look at existing records in the
form,
just
set the form's DataEntry property to Yes.
>
if you *do* want to see existing records, then add the following
code
to
the
form's OnLoad event, as
>
Private Sub Form_Load()
>
DoCmd.RunCommand acCmdRecordsGoToNew
>
End Sub
>
>

#2 I'm trying to develop a list, a shopping list if you will.
I
have
a
table with three columns. Let's say column one is "Item".
Column
two
is
"Cost", and column three is a "check box".

The intent would be when you go shopping you check, in the
"check
box",
the
items you want to buy. The cost column would total the items
chosen.
After
this I would just like to print the entire list.

Would it be best to create a form based on a query of the table?
Then
have
a report that would print the query?
>
you can just base your form on the table directly - no need for a
query.
>
assuming that you don't need to preserve the selections you
checkmark
from
"shopping trip" to the next, suggest the following:
>
1. add a field to the table, called Quantity, and enter zero (0)
in
each
record.
2. rename the Cost field to Price, and make sure the data type of
that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm wizard
on
the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name
it
txtCost,
and set its' ControlSource to
>
=Quantity*Price
>
6. in the form's Footer section, add another unbound textbox
control,
name
it txtTotal, and set its' ControlSource to
>
=Sum(Quantity*Price)
>
now as you enter quantities for each item you want to buy (leaving
the
zero
value for items you don't want to buy this time), you'll see the
total
cost
per product, and the total cost of your proposed shopping trip at
the
bottom
of the form.
>
7. add a button to the form, and call it cmdReset. add code to the
button
to
run an Update query that resets the Quantity field in the table to
zero
(0).
you can click the button after you print your shopping list, or
when
you
open the form to make a new list.
>
to print the list of items you selected: create a query based on
the
table.
in query design view, create a calculated field, as
>
Cost: Quantity*Price
>
add criteria to the Quantity field, as
>
0
>
you can use the AutoReport: Tabular wizard to quickly create a
columnar
report, based on the query, that lists only the items for which
you
entered
quantities in the form. in report design view, add an unbound
textbox
control, called txtTotal, and set its' ControlSource property to
>
=Sum(Quantity*Price)
>
hth
>
>

I'm really stumped on how to accomplish this. I know it must be
easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that I'm
really
not
very knowledgeable of MS Access, only enough to make me
dangerous.
Thanks,
Don...........


>
>


>
>


Aug 22 '06 #7

P: n/a
good job, i knew you'd figure it out just fine. yes, action queries -
Update, Delete, and Append - are very handy tools. and you're welcome. :)
"Don" <vz******@verizon.netwrote in message
news:%PzGg.11791$RQ5.5069@trnddc03...
Tina,
Thanks for your help. I did get the update query to work. I never knew
about that kind of option, cool. It took a little bit of trial and error
until I understood how to make it work but I did get it.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:A%********************@bgtnsc04-news.ops.worldnet.att.net...
When I click on the command button the "qryUpdateTo Zero" query opens
up
but
it doesn't reset anything.
you've created a Select query, Don. you need to create an Update query.
in
Access Help, do a search on Update Query and it'll tell you exactly how
to
make one. if you have trouble with it, post back with specific
questions.

hth
"Don" <vz******@verizon.netwrote in message
news:XveGg.19520$uV.18858@trnddc08...
Thanks again Tina,
I did understand where to put the text box, some things I get.
However on this button and update query control thing, is there
something
about the query I'm missing?
When I click on the command button the "qryUpdateTo Zero" query opens
up
but
it doesn't reset anything.
I'm sure it's something simple I don't understand.
Thanks again,
Don..........
"tina" <no****@address.comwrote in message
news:MQ*********************@bgtnsc05-news.ops.worldnet.att.net...
first, create an Update query to change the value of the Quantity
field
in
the table to zero (0); i'll call it qryUpdateToZero. add code to the
command
button's Click event procedure, as

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryUpdateToZero"
DoCmd.SetWarnings True

if you don't know how to create an event procedure, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, for illustrated step-by-step
instructions.

and btw, in the previous post, where i said

in report design view, add an unbound textbox
control, called txtTotal, and set its' ControlSource property to
>
=Sum(Quantity*Price)

i should have specificed that the txtTotal textbox control should be
placed
in the form's Footer section.

hth


"Don" <vz******@verizon.netwrote in message
news:yB_Fg.7591$u1.2655@trnddc05...
Thanks for your help. I've done everything except, I can't make
the
"Reset
Button" work.
How should this code read?
Thanks again for your help,
Don.........
"tina" <no****@address.comwrote in message
news:c_********************@bgtnsc04-news.ops.worldnet.att.net...
comments inline.

"Don" <vz******@verizon.netwrote in message
news:OVFFg.129$hP6.8@trnddc04...
I'm not very proficient with Access, probably only enough to
make
me
dangerous. With that said I've got two questions.
>
#1 (probably pretty simple). I know I've done this before but
how
do
I
get
my forms to open to a "new" record each time?

if you don't want to be able to look at existing records in the
form,
just
set the form's DataEntry property to Yes.

if you *do* want to see existing records, then add the following
code
to
the
form's OnLoad event, as

Private Sub Form_Load()

DoCmd.RunCommand acCmdRecordsGoToNew

End Sub


>
#2 I'm trying to develop a list, a shopping list if you will.
I
have
a
table with three columns. Let's say column one is "Item".
Column
two
is
"Cost", and column three is a "check box".
>
The intent would be when you go shopping you check, in the
"check
box",
the
items you want to buy. The cost column would total the items
chosen.
After
this I would just like to print the entire list.
>
Would it be best to create a form based on a query of the
table?
Then
have
a report that would print the query?

you can just base your form on the table directly - no need for
a
query.

assuming that you don't need to preserve the selections you
checkmark
from
"shopping trip" to the next, suggest the following:

1. add a field to the table, called Quantity, and enter zero (0)
in
each
record.
2. rename the Cost field to Price, and make sure the data type
of
that
field
is Currency.
3. delete the Yes/No (checkbox) field.
4. create the form from the table (you can use the AutoForm
wizard
on
the
database window's toolbar to do it quickly).
5. in the form design view, add an unbound textbox control, name
it
txtCost,
and set its' ControlSource to

=Quantity*Price

6. in the form's Footer section, add another unbound textbox
control,
name
it txtTotal, and set its' ControlSource to

=Sum(Quantity*Price)

now as you enter quantities for each item you want to buy
(leaving
the
zero
value for items you don't want to buy this time), you'll see the
total
cost
per product, and the total cost of your proposed shopping trip
at
the
bottom
of the form.

7. add a button to the form, and call it cmdReset. add code to
the
button
to
run an Update query that resets the Quantity field in the table
to
zero
(0).
you can click the button after you print your shopping list, or
when
you
open the form to make a new list.

to print the list of items you selected: create a query based
on
the
table.
in query design view, create a calculated field, as

Cost: Quantity*Price

add criteria to the Quantity field, as

0

you can use the AutoReport: Tabular wizard to quickly create a
columnar
report, based on the query, that lists only the items for which
you
entered
quantities in the form. in report design view, add an unbound
textbox
control, called txtTotal, and set its' ControlSource property to

=Sum(Quantity*Price)

hth


>
I'm really stumped on how to accomplish this. I know it must
be
easier
than
I'm making it into.
I'd really like some suggestions. Please keep in mind that
I'm
really
not
very knowledgeable of MS Access, only enough to make me
dangerous.
Thanks,
Don...........
>
>


>
>


>
>


Aug 22 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.