Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IIF Question in Access either in a table or a query

Posted on 2013-01-08
10
Medium Priority
?
224 Views
Last Modified: 2013-01-18
I have a table that stores information based on a check box in the form.  This data is stored as a -1.

For example field name [BSA].  If yes it will store -1.
I actually want the data to be stored as BSA.  Then I can link this to another table for a different function.

Is this possible?
0
Comment
Question by:gracie1972
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 38756981
Assuming your form is bound to your table where this BSA field is, make your checkbox unbound and on it's AfterUpdate event, add:
[BSA]="BSA"
Dirty = False

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
ID: 38756986
Do you have values other than BSA that you want to store in that field?

If so, you can use an Option Group whose stored values are set to BSA, ABC, XYZ, etc.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38756999
But if it is a single boolean value you can always keep it as a Yes/No field and query it as text when needed:


SELECT iif(YourField = TRUE, "BSA", "")  AS Organization
FROM YourTable
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:gracie1972
ID: 38757002
Can you help with the rest of the code?  I am not that versed in VB

Private Sub BSA_AfterUpdate()

 

End Sub
0
 

Author Comment

by:gracie1972
ID: 38757010
THere are 8 separate choices so I had to do separate check boxes.  
When I tried a multi-select it was not storing the data separately.  The end goal is to capture resources by skill set.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38757033
<<
THere are 8 separate choices so I had to do separate check boxes.  
>>

If those choices are related and are mutually exclusive  (such as "Organization type"), it is generally better design practice to use a single field to hold those value.

Option groups are designed for mutually exclusive data, with checkboxes or radio buttons for each option.  The default values stored are integers, but I believe you can have them store text as well.
0
 

Author Comment

by:gracie1972
ID: 38775701
I've requested that this question be deleted for the following reason:

I created a different solution than what was listed in this question.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38775702
I object to the deletion -

Ideally post your solution if you used a different method.

Also, we did offer valid solutions (even if they were different from your method) to the question as originally posted, and would have helped implement any if you had followed up.
0
 

Author Comment

by:gracie1972
ID: 38775723
I ended up creating separate check boxes that were bound to its own field linked by Resource ID.  It became to complicated to do this any other way with the solutions provided above.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question