two yes no fields in a form

G

Guest

I have in a subform 2 yes no fields. One is called 'action successful' and
one is called 'unfinished'. First the unfinished one is ticked but when the
action has been completed then i want to be able to tick 'action successful'
and unfinished will automatically be unticked.

The only difficulty is that for 4 of the records i want to be able to untick
unfinished but WITHOUT ticking action successful - is that possible.

Please could you give me a step by step answer because i don't always
understand the answers!! Thanks very much!
 
T

tina

to manually "untick" (uncheck) the Unfinished checkbox during form data
entry, simply click on it, or navigate to it and press the Space Bar on the
keyboard.

to automatically uncheck the Unfinished checkbox when the "ActionSuccessful"
checkbox is checked, add the following code to the ActionSuccessful
checkbox's AfterUpdate event procedure, as

If Me!ActionSuccessful Then
Me!Unfinished = False
End If

substitute the correct name for each checkbox, of course.

hth
 
G

Guest

Hi thank you but i'm not so familiar with event procedure. So where exactly
do i put this formula. I set after update to event procedure click on build
and i get loads of visual basics codes. Where exactly do i put the coding
that you told me, between what and what! Thanks for your help
 
G

Guest

I put it in the coding of Private Sub Action_Successful_AfterUpdate()
but when i tried it, it said stop and debug - is that the wrong place
 
T

tina

now that you've created a procedure for the AfterUpdate event, simply open
the form in design view and, in the Properties box, click on the small
button to the right of the AfterUpdate line. this opens the VBA Editor
window and places your cursor directly within the correct procedure. just
paste the code i gave you, and change the names to the correct checkbox
names.

hth
 
G

Guest

I did exactly as you said My fields are Action Successful and Unfinished so i
tried all different versions for action successful e.g. Action_Successful,
Action Successful, ActionSuccessful. But i kept on getting this message

Runtime Error '2465'

Microsoft Access can't find the field ActionSuccessful refered to in your
expression.
What could be the problem?
Thanks for your help
 
J

John Vinson

I did exactly as you said My fields are Action Successful and Unfinished so i
tried all different versions for action successful e.g. Action_Successful,
Action Successful, ActionSuccessful. But i kept on getting this message

Runtime Error '2465'

Microsoft Access can't find the field ActionSuccessful refered to in your
expression.
What could be the problem?

It could be that you have a table field named [Action Successful] and
that your code is referring to a field named [ActionSuccessful].

Spaces are not ignored. Doublecheck that the fieldname matches
exactly, and be sure to use [brackets] - they're always permitted, and
if the field name contains blanks or other non-alphanumeric characters
they are obligatory.

John W. Vinson[MVP]
 
T

tina

an excellent example of why you shouldn't put spaces (or any characters
besides letters or underscores) in anything you name in Access - it's a
royal pain when you're trying to write code. here's two things you can try:

let Access pick the name of the control, by *typing in* the code instead of
pasting it into your module. and instead of the "bang" (!), use a dot (.) -
that should cause a droplist to open, so you can pick the controlname *as
Access sees it*.

if that doesn't work, enclose the control name in brackets, as

If Me![ActionSuccessful] Then
Me!Unfinished = False
End If

hth
 
G

Guest

Thanks a million that did the trick!

tina said:
an excellent example of why you shouldn't put spaces (or any characters
besides letters or underscores) in anything you name in Access - it's a
royal pain when you're trying to write code. here's two things you can try:

let Access pick the name of the control, by *typing in* the code instead of
pasting it into your module. and instead of the "bang" (!), use a dot (.) -
that should cause a droplist to open, so you can pick the controlname *as
Access sees it*.

if that doesn't work, enclose the control name in brackets, as

If Me![ActionSuccessful] Then
Me!Unfinished = False
End If

hth


Database User said:
I did exactly as you said My fields are Action Successful and Unfinished so i
tried all different versions for action successful e.g. Action_Successful,
Action Successful, ActionSuccessful. But i kept on getting this message

Runtime Error '2465'

Microsoft Access can't find the field ActionSuccessful refered to in your
expression.
What could be the problem?
Thanks for your help
 

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