Checkboxes into a memo field

rotorheli

New member
Local time
Today, 17:11
Joined
Jul 11, 2008
Messages
3
Hi, I am fairly new to access but working my way through everything...so far so good.

My current problem is that I have a form with several check boxes for different options. What I want to do is combine all the checked checkboxes into one memo field in the table.

For example, I have a list of maneuvers with checkboxes next to them. I'm trying to get a memo field populated on the same form with only the names of the check checkboxes, if that makes sense.

I've tried searching for how to do this but, a.) nothing seemed to directly apply, and b.) I wasn't sure exactly how to word the search.

Thanks in advance!
 
My current problem is that I have a form with several check boxes for different options. What I want to do is combine all the checked checkboxes into one memo field in the table.

For example, I have a list of maneuvers with checkboxes next to them. I'm trying to get a memo field populated on the same form with only the names of the check checkboxes, if that makes sense.

No, to be perfectly honest, it makes no sense at all! Memo fields are designed to hold memos, aka notes! No data that could ever possibly need to be sorted, parsed, searched or in any way manipulated should ever be placed in memo fields! And the very fact that you already have these maneuvers displayed on your form by way of the checkboxes makes it even sillier to dispaly them again in a memo field.
 
Always call something like this from your form, say on the before update event.

Sub CheckedBoxes()
dim vHoldIt as variant

if Me.ChkBx1 then vHoldIt = "CheckBox1" Else vHoldIt = ""
if Me.ChkBx2 then vHoldIt = vHoldIt & " " & "CheckBox2"
if Me.ChkBx3 then vHoldIt = vHoldIt & " " & "CheckBox3"

Me.mCheckBoxes = trim(vHoldIt)

exit sub
 
I don't know, this could be a valuable exercise. You could use the value in the memo field as a recipe for a piece of manufacturing equipment or as an automated video game player (for people who are too lazy to do lazy people's stuff).

The (other) fine gentleman from Texas has already given you the correct answer.

So, why ARE you doing this (just for our edification)?
 
No, to be perfectly honest, it makes no sense at all! Memo fields are designed to hold memos, aka notes! No data that could ever possibly need to be sorted, parsed, searched or in any way manipulated should ever be placed in memo fields! And the very fact that you already have these maneuvers displayed on your form by way of the checkboxes makes it even sillier to dispaly them again in a memo field.

Let me explain so it makes more sense:

I am generating weekly reports of flight training. On one form to create a progress report, I have several check box fields with different maneuvers (autorotations, quickstops, normal takeoffs, etc.) where whoever is using the database can simply check the boxes next to which maneuvers were performed. After that, I want to save all the fields that were checked to a memo field (the character size of all the maneuvers performed may be too great for a text field I thought). Then, in the report, I would just display the memo field which has combined all the maneuvers into one field.

For example, in the form it would have something like:
[ ] Autorotations [X] Normal Approach
[X] Quickstops
[ ] Confined Area

Then, when you went to generate the report it would have something like:
Pilot Name
Date
Maneuvers performed: Quickstops, Normal Approach


I figured because I had such a large amount of possible manuevers that could be filled in there, that I would need to use a memo field for size constraints.

Maybe there is another way to accomplish this? As I said, I'm still very new to access and pretty doing it by trial and error.

Thanks for the replies!
 
There are other ways but I see nothing wrong with the approach you're using, if it works for you. It's really difficult to aggregate and concatenate text in Access so this seems like a valid technique someone could use.

In some way it does seem like a waste to store calculated values but, what the hey? May as well...I'm sure your computer has plenty of storage capacity and peta-flops to handle it.
 

Users who are viewing this thread

Back
Top Bottom