Check Box...simple solution?

S

shutterspeed

I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out how
to do it. It has been a while since I worked with Access 2003.

Ideally though, I would like Access to change the data on import. When that
field is not empty, just put in a "yes" so the checkbox thing will work by
itself and properly. This would be the better way.

But whatever is easier really...I just need the checkbox to show in my form
right now so I can get this things working.

Thanks

Scott Morris
Orlando, FL
 
J

Jeff Boyce

Why? As in "why do you need a (redundant) checkbox to tell you that the
adjacent field has something in it?"

I'm assuming you intend to use that checkbox to accomplish something, but
you haven't explained what that is...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out how
to do it. It has been a while since I worked with Access 2003.

Ideally though, I would like Access to change the data on import. When that
field is not empty, just put in a "yes" so the checkbox thing will work by
itself and properly. This would be the better way.

But whatever is easier really...I just need the checkbox to show in my form
right now so I can get this things working.

Thanks

Scott Morris
Orlando, FL

If the associated textbox on the form is txtWhatever, set the control source
of the checkbox to

=Not IsNull([txtWhatever])

The yes/no field should NOT be stored in the table, as it's redundant.
 
S

shutterspeed

Its as simple as wanting to be able to view it as checkbox in the form....not
the table or data itself. Nothing more really. Trying to keep it simple.

However, the best way would be to transform the data to the proper format so
Access can do its "checkbox thang" properly.

The real problem is the script I am using seems to put the value "Checked" in
the data field and Access doesnt know anything else to do with that but see
it as text as far as I can tell. So if there is a way to get Access to
replace "Checked" with a "yes" and a no if the field is empty, then that
would be great to, and the better way.

I have never had to modify data on import before. So I dont know how to do
that either.

I thought just getting the checkbox to display a check if the field data
equals "Checked" would be easiest...but apparently not.

SRM

Jeff said:
Why? As in "why do you need a (redundant) checkbox to tell you that the
adjacent field has something in it?"

I'm assuming you intend to use that checkbox to accomplish something, but
you haven't explained what that is...

Regards

Jeff Boyce
Microsoft Office/Access MVP
I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out
[quoted text clipped - 14 lines]
Scott Morris
Orlando, FL
 
S

shutterspeed

Its as simple as wanting to be able to view it as checkbox in the form....not
the table or data itself. Nothing more really. Trying to keep it simple.

However, the best way would be to transform the data to the proper format so
Access can do its "checkbox thang" properly.

The real problem is the script I am using seems to put the value "Checked" in
the data field and Access doesnt know anything else to do with that but see
it as text as far as I can tell. So if there is a way to get Access to
replace "Checked" with a "yes" and a no if the field is empty, then that
would be great to, and the better way.

I have never had to modify data on import before. So I dont know how to do
that either.

I thought just getting the checkbox to display a check if the field data
equals "Checked" would be easiest...but apparently not.

SRM

Jeff said:
Why? As in "why do you need a (redundant) checkbox to tell you that the
adjacent field has something in it?"

I'm assuming you intend to use that checkbox to accomplish something, but
you haven't explained what that is...

Regards

Jeff Boyce
Microsoft Office/Access MVP
I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out
[quoted text clipped - 14 lines]
Scott Morris
Orlando, FL
 
S

shutterspeed

I dont think I ever said I had a textbox on the form did I?

I simply said...one more time...that I want a checkbox to display a check if
the desired field is not empty.

Come to think of it I can probably do that with an unbound checkbox and a
default value function.

Then, like I said before, ideally, I would like to change the data in the
table on import so that it is in a yes/no format. Is there an easy way to do
that?
I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out how
[quoted text clipped - 11 lines]
Scott Morris
Orlando, FL

If the associated textbox on the form is txtWhatever, set the control source
of the checkbox to

=Not IsNull([txtWhatever])

The yes/no field should NOT be stored in the table, as it's redundant.
 
J

John W. Vinson

I dont think I ever said I had a textbox on the form did I?

I simply said...one more time...that I want a checkbox to display a check if
the desired field is not empty.

You know what "the desired field" is.
You know the structure of your table.
You know the Recordsource for your form and its structure.

We don't. We can only see what you post.
Come to think of it I can probably do that with an unbound checkbox and a
default value function.

Then, like I said before, ideally, I would like to change the data in the
table on import so that it is in a yes/no format. Is there an easy way to do
that?

Well, you're obviously not importing it into a form. You want to import a
table (from somewhere you haven't specified), discard the data in some field
(of a datatype you haven't specified), and instead import a
Yes/-1/True/checked into a Yes/No field in your table if the field is NULL? If
so, link to (rather than importing) the source table and include a calculated
field:

HasData: Not IsNull([fieldname])

and append this field to your yes/no field in the table.
 
S

shutterspeed via AccessMonster.com

Thanks...I will try that. I am just frustrated from some other terrible tech-
support issues I have had this week, and I dont like being so illiterate at
something I used to do all the time (and give the tips instead of ask for
them!)

I will give that a try...

Thanks
I dont think I ever said I had a textbox on the form did I?

I simply said...one more time...that I want a checkbox to display a check if
the desired field is not empty.

You know what "the desired field" is.
You know the structure of your table.
You know the Recordsource for your form and its structure.

We don't. We can only see what you post.
Come to think of it I can probably do that with an unbound checkbox and a
default value function.

Then, like I said before, ideally, I would like to change the data in the
table on import so that it is in a yes/no format. Is there an easy way to do
that?

Well, you're obviously not importing it into a form. You want to import a
table (from somewhere you haven't specified), discard the data in some field
(of a datatype you haven't specified), and instead import a
Yes/-1/True/checked into a Yes/No field in your table if the field is NULL? If
so, link to (rather than importing) the source table and include a calculated
field:

HasData: Not IsNull([fieldname])

and append this field to your yes/no field in the table.
 
S

shutterspeed via AccessMonster.com

OK...that would work...but to answer my other question (I got the checkbox
display to work the way I want for now, so on to the fine-tuning)...

Is there a way to change/format data automatically on import? Like I said, if
a field has anything in it at all I want to give it a 0 or a yes, and it if
is empty, I want it to be a -1 or a no.

I just dont see a way to do that automatically on import. Sure, I can go in
an change it by hand, but that is a pain. I am trying to make the seamless.

Thanks

SRM
I dont think I ever said I had a textbox on the form did I?

I simply said...one more time...that I want a checkbox to display a check if
the desired field is not empty.

You know what "the desired field" is.
You know the structure of your table.
You know the Recordsource for your form and its structure.

We don't. We can only see what you post.
Come to think of it I can probably do that with an unbound checkbox and a
default value function.

Then, like I said before, ideally, I would like to change the data in the
table on import so that it is in a yes/no format. Is there an easy way to do
that?

Well, you're obviously not importing it into a form. You want to import a
table (from somewhere you haven't specified), discard the data in some field
(of a datatype you haven't specified), and instead import a
Yes/-1/True/checked into a Yes/No field in your table if the field is NULL? If
so, link to (rather than importing) the source table and include a calculated
field:

HasData: Not IsNull([fieldname])

and append this field to your yes/no field in the table.
 
J

John W. Vinson

OK...that would work...but to answer my other question (I got the checkbox
display to work the way I want for now, so on to the fine-tuning)...

Is there a way to change/format data automatically on import? Like I said, if
a field has anything in it at all I want to give it a 0 or a yes, and it if
is empty, I want it to be a -1 or a no.

I just dont see a way to do that automatically on import. Sure, I can go in
an change it by hand, but that is a pain. I am trying to make the seamless.

You can *link* to the external file, and run an Append query using the
Isnull() function to convert the value to a yes/no.
 
L

Larry Linson

Is there a good reason that you don't want to use a Calculated Field in your
Query, and bind the Check Box to that? In the Query builder you could have:

MyX : IIF (IsNull(NameOfYourField), False, True)

Best about this is that you wouldn't have to include an invisible Control on
a Report (Access is so smart it doesn't carry the data for Fields that
aren't actually used in the Report), if you wanted to create a Report, as
well as a Form.

Larry Linson
Microsoft Office Access MVP

shutterspeed said:
I dont think I ever said I had a textbox on the form did I?

I simply said...one more time...that I want a checkbox to display a check
if
the desired field is not empty.

Come to think of it I can probably do that with an unbound checkbox and a
default value function.

Then, like I said before, ideally, I would like to change the data in the
table on import so that it is in a yes/no format. Is there an easy way to
do
that?
I want a check box on a data form to simply show a check when the the
associated field is not empty. Seems so simple, yet I cannot figure out
how
[quoted text clipped - 11 lines]
Scott Morris
Orlando, FL

If the associated textbox on the form is txtWhatever, set the control
source
of the checkbox to

=Not IsNull([txtWhatever])

The yes/no field should NOT be stored in the table, as it's redundant.
 
S

shutterspeed via AccessMonster.com

Actually, I would just like to change the data when it is imported to begin
with and be done with it. No querries....etc. Just change it at the beginning
and be done with it! Really, it would be cool if there was a way to do it in
the mySQL database on my server so it is done when i export the file anyway...
but I am not that knowledgable.

Larry said:
Is there a good reason that you don't want to use a Calculated Field in your
Query, and bind the Check Box to that? In the Query builder you could have:

MyX : IIF (IsNull(NameOfYourField), False, True)

Best about this is that you wouldn't have to include an invisible Control on
a Report (Access is so smart it doesn't carry the data for Fields that
aren't actually used in the Report), if you wanted to create a Report, as
well as a Form.

Larry Linson
Microsoft Office Access MVP
I dont think I ever said I had a textbox on the form did I?
[quoted text clipped - 24 lines]
 

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