473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

A couple of questions

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
7 1431
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bjs | last post by:
I hope I've got the right group here and apologies if I haven't. I'm a hobby programmer and have just upgraded to Visual Basic.net and have a couple of questions if anybody can help. In VB 6...
1
by: hoochiegooch | last post by:
Hi, all. I have a couple of questions about NAnt. 1. Is there a better way to invoke NAnt from a C# "Master Test Rig" than shelling out? IOW, how should an ASP.NET web app or Windows Service...
21
by: Rob Somers | last post by:
Hey people, I read a good thread on here regarding the reason why we use function prototypes, and it answered most of my questions, but I wanted to double check on a couple of things, as I am...
1
by: dln | last post by:
Howdy. I'm a bit new to C# and got a couple of quick questions that perhaps someone can help me answer. First, is there a property that you set on a TextBox control that will force the control to...
4
by: Sccr18 | last post by:
I just have a couple of easy questions: 1. In Asp.net using Vb is there a way to list all the possible characters without listing them all like Char() = "abc..."? 2. I was trying to set the focus...
3
by: punt | last post by:
I've got a couple of questions about a deployed VB.NET application. Firstly can a deployed application remember any variables(single string) after being closed down and re-opened, without the use...
0
by: Marc | last post by:
Hi, I'm working with a customer that is trying to find a solution to provide geographical redundancy. Our application is currently using IBM DB2 v8.2. I have a couple of questions with regards...
3
by: Ron | last post by:
Hello everyone, I have a couple of questions really quick questions. I am creating a dispatch database. What I would really like to do is have to option of automatically inserting the time...
3
by: melton9 | last post by:
I'm just getting into using datagrid and have a couple of questions. 1.)How do you get the grid to show the values of a datatable automatically? Currently I have to hit the + sign and then...
0
by: Newish | last post by:
Hi Couple of questions on datagrid 1) Is there a performance issue when using datagrid to display data from a datatable. 2) Is there a security issue when using datagrid to display data...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.