Using IIF with checkbox?

A

Amelia

First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!
 
F

fredg

First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!

Not a good idea to 'move' records.
Add the [SoldItem] Check Box field to the table, and then also add
that check box field onto your data entry form.
Use a query as record source of your form.
Set the criteria on the [SoldItem] column to:
0

When you open the form, only records that have not been sold will
display on the form. When that item is sold simply check the box. When
you requery or close and re-open the form, that sold item will no
longer appear.

See if you can keep that additional data in the same table.
Probably no need for a different table to add additional information,
but without knowing what the additional information is and what you
intend to do with it, I won't comment more on that.
 
A

Amelia

That makes sense. Thanks. As far as having the additional information in a
new table. I would like it to be seperate or have it show only if the
checkbox is marked sold. (not sure how I would do that either, or if it is
possible)

So for instance if this pc was sold, data entry would mark it as sold then
additional fields would pop up that need to be filled in (selling price, sold
date, pick up date, etc...)

Does that help you make a determination in the best way to help?


fredg said:
First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!

Not a good idea to 'move' records.
Add the [SoldItem] Check Box field to the table, and then also add
that check box field onto your data entry form.
Use a query as record source of your form.
Set the criteria on the [SoldItem] column to:
0

When you open the form, only records that have not been sold will
display on the form. When that item is sold simply check the box. When
you requery or close and re-open the form, that sold item will no
longer appear.

See if you can keep that additional data in the same table.
Probably no need for a different table to add additional information,
but without knowing what the additional information is and what you
intend to do with it, I won't comment more on that.
 
F

fredg

That makes sense. Thanks. As far as having the additional information in a
new table. I would like it to be seperate or have it show only if the
checkbox is marked sold. (not sure how I would do that either, or if it is
possible)

So for instance if this pc was sold, data entry would mark it as sold then
additional fields would pop up that need to be filled in (selling price, sold
date, pick up date, etc...)

Does that help you make a determination in the best way to help?

fredg said:
First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!

Not a good idea to 'move' records.
Add the [SoldItem] Check Box field to the table, and then also add
that check box field onto your data entry form.
Use a query as record source of your form.
Set the criteria on the [SoldItem] column to:
0

When you open the form, only records that have not been sold will
display on the form. When that item is sold simply check the box. When
you requery or close and re-open the form, that sold item will no
longer appear.

See if you can keep that additional data in the same table.
Probably no need for a different table to add additional information,
but without knowing what the additional information is and what you
intend to do with it, I won't comment more on that.

Add those fields to the table.
Add those new fields to the query that is the record source for the
form.
Add those fields to the form.
In the Tag property of each of the controls you wish to normally hide,
write:
Hide

Then code the Form's Current event:

Private Sub Form_Current()
Dim c As Control
For Each c In Controls
If c.Tag = "Hide" Then
If [SoldItem] = -1 Then
c.Visible = True
Else
c.Visible = False
End If
End If
Next
End Sub

Place the same code in the [SortItem] AfterUpdate event.

The controls will become visible only when the SortItem check box has
a check.
 
A

Amelia

Thanks Fred, I am going to give it a whirl. I think this is going to work!

My one question is this, would if I did not use a query to get my form?

fredg said:
That makes sense. Thanks. As far as having the additional information in a
new table. I would like it to be seperate or have it show only if the
checkbox is marked sold. (not sure how I would do that either, or if it is
possible)

So for instance if this pc was sold, data entry would mark it as sold then
additional fields would pop up that need to be filled in (selling price, sold
date, pick up date, etc...)

Does that help you make a determination in the best way to help?

fredg said:
On Tue, 7 Jul 2009 09:21:03 -0700, Amelia wrote:

First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!

Not a good idea to 'move' records.
Add the [SoldItem] Check Box field to the table, and then also add
that check box field onto your data entry form.
Use a query as record source of your form.
Set the criteria on the [SoldItem] column to:
0

When you open the form, only records that have not been sold will
display on the form. When that item is sold simply check the box. When
you requery or close and re-open the form, that sold item will no
longer appear.

See if you can keep that additional data in the same table.
Probably no need for a different table to add additional information,
but without knowing what the additional information is and what you
intend to do with it, I won't comment more on that.

Add those fields to the table.
Add those new fields to the query that is the record source for the
form.
Add those fields to the form.
In the Tag property of each of the controls you wish to normally hide,
write:
Hide

Then code the Form's Current event:

Private Sub Form_Current()
Dim c As Control
For Each c In Controls
If c.Tag = "Hide" Then
If [SoldItem] = -1 Then
c.Visible = True
Else
c.Visible = False
End If
End If
Next
End Sub

Place the same code in the [SortItem] AfterUpdate event.

The controls will become visible only when the SortItem check box has
a check.
 
A

Amelia

It worked perfectly! Thanks!

fredg said:
That makes sense. Thanks. As far as having the additional information in a
new table. I would like it to be seperate or have it show only if the
checkbox is marked sold. (not sure how I would do that either, or if it is
possible)

So for instance if this pc was sold, data entry would mark it as sold then
additional fields would pop up that need to be filled in (selling price, sold
date, pick up date, etc...)

Does that help you make a determination in the best way to help?

fredg said:
On Tue, 7 Jul 2009 09:21:03 -0700, Amelia wrote:

First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!

Not a good idea to 'move' records.
Add the [SoldItem] Check Box field to the table, and then also add
that check box field onto your data entry form.
Use a query as record source of your form.
Set the criteria on the [SoldItem] column to:
0

When you open the form, only records that have not been sold will
display on the form. When that item is sold simply check the box. When
you requery or close and re-open the form, that sold item will no
longer appear.

See if you can keep that additional data in the same table.
Probably no need for a different table to add additional information,
but without knowing what the additional information is and what you
intend to do with it, I won't comment more on that.

Add those fields to the table.
Add those new fields to the query that is the record source for the
form.
Add those fields to the form.
In the Tag property of each of the controls you wish to normally hide,
write:
Hide

Then code the Form's Current event:

Private Sub Form_Current()
Dim c As Control
For Each c In Controls
If c.Tag = "Hide" Then
If [SoldItem] = -1 Then
c.Visible = True
Else
c.Visible = False
End If
End If
Next
End Sub

Place the same code in the [SortItem] AfterUpdate event.

The controls will become visible only when the SortItem check box has
a check.
 
A

AYHAN MUSLU PC

iletisinde şunu yazdı said:
First, can you use IIF with a checkbox?

What I want to do is if the checkbox is marked(item is sold), then after
update (checkmark is checked) I want it to append that item to a new table
and open the form that goes with the table and if it is not done then do
nothing (null?).

So do I need to create an append query and then have it open the query?

What it is is if an item is sold at auction, I want to check that the item
is sold and then move that item to a sold item table that has more
information about the sale.

Any help would be great!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top