Reputation: 4405
I am programming a simple check box in MS Access. This is how it goes:
This is my first foray into Access programming. My pseudo code is as follows:
Private Sub distchk_Click()
if distchk is checked then
Me.ECOSITE = "ds(" & Me.ECOSITE & ")"
else:
Me.Ecosite
End Sub
I tested:
Private Sub distchk_Click()
Me.ECOSITE = "ds(" & Me.ECOSITE & ")"
End Sub
but it keeps adding additional ds() anytime I check it, and won't remove it if I uncheck it.
Any suggestions would be great!
Mike
Upvotes: 0
Views: 1163
Reputation: 24207
You are making unnecessary work for yourself and a more confusing interface for your users. You are collecting two discrete pieces of data: LandCoverType (a Text field) and IsDisturbed (a Yes/No field, aka boolean or bit field) so I see no reason to combine them in an input form. You are not providing the user with any additional information by wrapping the land cover types in "ds()". I would suggest two alternative approaches:
Two separate fields (preferred method)
LandCoverType
)=IIf([IsDisturbed], "ds(" & [LandCoverType] & ")", [LandCoverType])
)One combined field
ds()
(eg, if your RowSource is a value list: b1, b2, c1, ds(b1), ds(b2), ds(c1)
)Upvotes: 3