How do you update a checkbox?

G

Guest

How can a after update be completed on a check box. The reason I need this is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there is a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl" form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
A

Arvin Meyer [MVP]

If the checkbox is on the form and bound to the underlying table or query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control changes
the condition. If you are clicking on the checkbox directly, just save and
requery.
 
G

Guest

Hey I tried that, but it said Compile Error: Method or data error not found.

Any suggestions? Thanks

Arvin Meyer said:
If the checkbox is on the form and bound to the underlying table or query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control changes
the condition. If you are clicking on the checkbox directly, just save and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
How can a after update be completed on a check box. The reason I need this
is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there is a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl" form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
A

Arvin Meyer [MVP]

On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools >>>
Options, you should be able to spot which line is causing the error, It will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Hey I tried that, but it said Compile Error: Method or data error not
found.

Any suggestions? Thanks

Arvin Meyer said:
If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
How can a after update be completed on a check box. The reason I need
this
is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there is
a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
G

Guest

Good day;

I am not sure I know what you mean I am not the best with code. But the
"Private Sub Check 38" which is the check box in question, is highlighted
yellow along with the ".REX" after "Me" is highlighed grey.

Do I need to insert a event procedure break or something there somewhere?

Arvin Meyer said:
On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools >>>
Options, you should be able to spot which line is causing the error, It will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Hey I tried that, but it said Compile Error: Method or data error not
found.

Any suggestions? Thanks

Arvin Meyer said:
If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

How can a after update be completed on a check box. The reason I need
this
is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there is
a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
A

Arvin Meyer [MVP]

OK, it should look like this:

1. The property sheet should have [Event Procedure] in the AfterUpdate event

2 Code assuming REX is Check38 (no space in the name):

Private Sub Check38_AfterUpdate()
Me.Check38 = True
Me.Dirty = False ' save the form
Me.Requery
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Good day;

I am not sure I know what you mean I am not the best with code. But the
"Private Sub Check 38" which is the check box in question, is highlighted
yellow along with the ".REX" after "Me" is highlighed grey.

Do I need to insert a event procedure break or something there somewhere?

Arvin Meyer said:
On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools >>>
Options, you should be able to spot which line is causing the error, It
will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Hey I tried that, but it said Compile Error: Method or data error not
found.

Any suggestions? Thanks

:

If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

How can a after update be completed on a check box. The reason I
need
this
is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there
is
a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
G

Guest

Man this worked perfect, Thanks alot I have been toying with this of and on
for months now. I gotta learn code, would make things alot easier. Thaks
again!

Arvin Meyer said:
OK, it should look like this:

1. The property sheet should have [Event Procedure] in the AfterUpdate event

2 Code assuming REX is Check38 (no space in the name):

Private Sub Check38_AfterUpdate()
Me.Check38 = True
Me.Dirty = False ' save the form
Me.Requery
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Good day;

I am not sure I know what you mean I am not the best with code. But the
"Private Sub Check 38" which is the check box in question, is highlighted
yellow along with the ".REX" after "Me" is highlighed grey.

Do I need to insert a event procedure break or something there somewhere?

Arvin Meyer said:
On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools >>>
Options, you should be able to spot which line is causing the error, It
will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Hey I tried that, but it said Compile Error: Method or data error not
found.

Any suggestions? Thanks

:

If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

How can a after update be completed on a check box. The reason I
need
this
is
I run a query report that draws from checked boxes. So I have a form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form there
is
a
button that runs a query " bases on "yes" or checked boxes from the
"DualEmpl" form. But for some reason I have to close the "DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
A

Arvin Meyer [MVP]

Glad it worked. The first several years I worked with macros. I actually
wrote some very sophisticated macros and an application that has been in use
for almost 13 years now. But is was way too limiting. There is so much power
in VBA that it's worth learning. True the code below might have been written
with a macro, but probably not as quickly. Two books that might be helpful
are:

Access 2007 (there are also earlier versions) Inside & Out
and
Access 2007 (also earlier versions) VBA
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Man this worked perfect, Thanks alot I have been toying with this of and
on
for months now. I gotta learn code, would make things alot easier. Thaks
again!

Arvin Meyer said:
OK, it should look like this:

1. The property sheet should have [Event Procedure] in the AfterUpdate
event

2 Code assuming REX is Check38 (no space in the name):

Private Sub Check38_AfterUpdate()
Me.Check38 = True
Me.Dirty = False ' save the form
Me.Requery
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Good day;

I am not sure I know what you mean I am not the best with code. But the
"Private Sub Check 38" which is the check box in question, is
highlighted
yellow along with the ".REX" after "Me" is highlighed grey.

Do I need to insert a event procedure break or something there
somewhere?

:

On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools

Options, you should be able to spot which line is causing the error,
It
will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Hey I tried that, but it said Compile Error: Method or data error
not
found.

Any suggestions? Thanks

:

If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just
save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

How can a after update be completed on a check box. The reason I
need
this
is
I run a query report that draws from checked boxes. So I have a
form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form
there
is
a
button that runs a query " bases on "yes" or checked boxes from
the
"DualEmpl" form. But for some reason I have to close the
"DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 
G

Guest

Thanks, I'll check those out!

Arvin Meyer said:
Glad it worked. The first several years I worked with macros. I actually
wrote some very sophisticated macros and an application that has been in use
for almost 13 years now. But is was way too limiting. There is so much power
in VBA that it's worth learning. True the code below might have been written
with a macro, but probably not as quickly. Two books that might be helpful
are:

Access 2007 (there are also earlier versions) Inside & Out
and
Access 2007 (also earlier versions) VBA
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Roby said:
Man this worked perfect, Thanks alot I have been toying with this of and
on
for months now. I gotta learn code, would make things alot easier. Thaks
again!

Arvin Meyer said:
OK, it should look like this:

1. The property sheet should have [Event Procedure] in the AfterUpdate
event

2 Code assuming REX is Check38 (no space in the name):

Private Sub Check38_AfterUpdate()
Me.Check38 = True
Me.Dirty = False ' save the form
Me.Requery
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Good day;

I am not sure I know what you mean I am not the best with code. But the
"Private Sub Check 38" which is the check box in question, is
highlighted
yellow along with the ".REX" after "Me" is highlighed grey.

Do I need to insert a event procedure break or something there
somewhere?

:

On which line does your event procedure break?

If you have Break on unhandled errors set in the code window's Tools

Options, you should be able to spot which line is causing the error,
It
will
be highlighted in yellow.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Hey I tried that, but it said Compile Error: Method or data error
not
found.

Any suggestions? Thanks

:

If the checkbox is on the form and bound to the underlying table or
query:

Me.REX = True
Me.Dirty = False ' save the form
Me.Requery

as an event procedure in the AfterUpdate event of whatever control
changes
the condition. If you are clicking on the checkbox directly, just
save
and
requery.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

How can a after update be completed on a check box. The reason I
need
this
is
I run a query report that draws from checked boxes. So I have a
form
"DualEmpl" with a check box [REX]. Also on the "DualEmpl" form
there
is
a
button that runs a query " bases on "yes" or checked boxes from
the
"DualEmpl" form. But for some reason I have to close the
"DualEmpl"
form
before the [REX] check box will update.

Any help will be greatly appreciated!!!!
 

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