Hello! (MS Access 2007 form)
I have three yes/no (check box) fields for registration:
1. Full year (Sept-May)
2. 1st term (Sept-Dec)
3. 2nd term (Jan-May)
Of course, if they register and pay for the full year, I would like the 1st term and second term check boxes to automatically check themselves off. If they don't, I want to be able to check one or the other or both.
I've tried using an iff:
=IIf([Full Year]=True,-1,0)
but I'm not sure where to put it. If I put it into the Control Source, I lose the ability to check the 1st term or second term box by itself, and also it ceases to be stored with the person (which is important).
I'm sure it's exceedingly simple...any ideas out there?
11 3389 jimatqsi 1,271
Recognized Expert Top Contributor
Put your code in the afterupdate event of the checkbox that controls the other checkbox(es). That way, as soon as that control is updated and you leave the control (tab to the next control) the code is executed.
Jim
Thanks! Tried putting this into the afterupdate:
=IIf([Full Year]=-1,[1st semester]=-1,[1st semester]=0)
I've tried using True, False, Yes, No, everything. Nothing happens. I also tried putting it into the Beforeupdate of the 1st semester box. Nothing happened then either! I'd just be happy if SOMETHING happened, so I could debug!
Sorry to be such a noob...could you dumb it down for me even more? THANKS! : )
jimatqsi 1,271
Recognized Expert Top Contributor
:) Yes, I understand your frustration. It should be - if me![Full Year] = -1 then
-
me![1st Semester] = -1
-
me![2nd Semester] = -1
-
else
-
-
me![1st Semester] = 0
-
me![2nd Semester] = 0
-
endif
I'm not so sure about the wisdom of the =0s in the Else, but perhaps that is logically correct for you.
Jim
THANK YOU! THANK YOU! THANK YOU! You're right - there is NO wisdom to putting =0 in the Else. I omitted it. Works perfectly now!
I had just never worked with if's in the Code Builder before, only iif's in the expression builder. Big difference!
Thanks again! I so appreciate it!
Melody
I'm not sure I agree with the setup here. Unless there is absolutely no difference between registering for 1st term, then later registering for 2nd term and with registering for both at the same time, I would make these RadioButtons with 1st, 2nd, Both. Only one could be chosen.
If you proceed as you are though, then the code should be: - me![1st Semester] = me![Full Year]
-
me![2nd Semester] = me![Full Year]
This would correctly allow [Full Year] to be unchecked, and each semister would be unchecked also.
Thanks for the feedback! There actually is quite a big difference. If you decide to register for the full year at the outset, you get a cheaper rate. Many members choose to only register in the fall, and then choose (or not) to register again in the winter. In this case, they would have 1st Semester checked, and 2nd Semester Checked, but not Full Year. They end up paying more since they've paid in two installments, if you like. I key my Member Info sheets off of the 1st Semester and 2nd Semester checkboxes, so that I have different lists for each semester, so it is important to track them separately. But, now that it will automagically check 1st Semester and 2nd Semester when I check Full Year, this makes it no more work at all!
I've gone back and forth with just having an "Active Member" checkbox to key my reports off of, but then I can't go back and print out Member Info sheets from last fall, which I'd like to do.
This was my very first database, and one thing I learned is to plan it out well at the outset! (which I probably didn't do as well as I could!). Ahhhh...the old learning curve!
jimatqsi 1,271
Recognized Expert Top Contributor
Melody,
You're in for a lot of fun. The "code builder" is where the action is. I've been programming in Access for 10 years and I learn something nearly every day from posts on bytes.com, so stick around. Read random threads for 15 minutes a day, you'll be surprised how quickly it sinks in.
Jim
@jimatqsi
What a great idea! I've just been bopping around here trying to figure out why Access throws a fit when I import a text file ("Subscript Out of Range"). It all looks so good! Back to the search...
jimatqsi 1,271
Recognized Expert Top Contributor @Mmmel
You might try Google's advanced search page and specify to search only domain bytes.com. I find that often works better than using the site's search function.
Importing text is usually pretty easy to get it done. Try importing only one column, then add another and another, that might narrow it down some.
Jim
Thanks, Jim! I eventually just gave up and typed in the info (only for four people), but I will work on solving this one.
Cheers!
: )
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John |
last post by:
Hey guys,
In a form of 3 checkboxes, at least one of them has to be checked. How would
I go about making sure at least one is checked before the form is submitted?
If it's not checked, an alert...
|
by: Morten Wennevik |
last post by:
In the middle to a heavy recursive loop, can you pause and force a message
check?
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
by: Brian |
last post by:
I've got a datagrid with a checkbox column. Everything looks good.
I'd like to implement a chcekbox that when checked causes all the
checkboxes in the grid to become checked, and vice versa. Any...
|
by: toton |
last post by:
In C++ , when the class is declared in the header & not implemented in
the cpp, the linker is not giving a error untill the method gets
called. How to ensure that all non pure-virtual method...
|
by: ramprabu |
last post by:
Hi,
In a html page has 6 check boxes all are same id and different values. I will submit the html page it will sumitted to one aspx page. How to get all the checked check box values in...
| |
by: haresh.amis |
last post by:
hello to all,
I m using .net 2.0 and i face a problem that is as under
Well I have a checkboxlist which i bound in .cs page
now I want to count that how many checkboxes ate checked ( In...
|
by: olivero |
last post by:
Hi group,
How do I check all check box controls on a Continuous Form?
I have a form (Main) with two SubForms (Sub1 and Sub2). Sub1 has a button that is supposed to check all the check boxes...
|
by: burg226 |
last post by:
hey all, i'm trying to make an employee directory in a Table with check boxes beside each employees email address. What i want it to do is at the bottom of the directory i want a Button to compile...
|
by: DaveRook |
last post by:
Hello
How do I display a checked check box list?
I have a list which gives options A, B and C.
If some one checks A and C and clicks Search, I just want it to write A and C!
If some one...
|
by: asymtotes |
last post by:
hello n gud day every one
basically my project is about personality test, it content 6 page of question which each page has 13 question
page 1
-----------------------
question 1 ...
|
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,...
| |
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...
|
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,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |