IIF Question in Access either in a table or a query

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?
gracie1972Asked:
Who is Participating?
 
IrogSintaCommented:
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
 
mbizupCommented:
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
 
mbizupCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
gracie1972Author Commented:
Can you help with the rest of the code?  I am not that versed in VB

Private Sub BSA_AfterUpdate()

 

End Sub
0
 
gracie1972Author Commented:
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
 
mbizupCommented:
<<
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
 
gracie1972Author Commented:
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
 
mbizupCommented:
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
 
gracie1972Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.