Check box recorded as question mark

  • Thread starter Thread starter Gary Schuldt
  • Start date Start date
G

Gary Schuldt

I want to display a check box chkQ on a form to indicate "Questionable?"
info (or not) to the user.

However, I want to store either a Null or a "?" in the record field txtQ for
ease of display in a downstream (non-Access) program.

What's the best design for this?

My first thought was two controls:

1. chkQ as an unbound check box on the form

2. txtQ as the Text field in the record.

But then I have to write some event handlers to handle both the Change in
chkQ as well as the initial displayed value of it (checked or not) based on
the value of txtQ.

Is there an easier way?

Thanks!

Gary
 
It sounds like you want to make the table field a single-character text
field, storing either "?" or null. For this to act like a Check box, I
would suggest putting a small toggle button control on the form, and coding
the AfterUpdate event to toggle the value:

Private Sub Form_Current()
Toggle2 = (Nz([Questionable], "") = "?") ' Use Nz to avoid "invalid
use of null" error
Toggle2.Caption = IIf(Toggle2, "?", "")
End Sub

Private Sub Toggle2_AfterUpdate()
[Questionable] = IIf(Toggle2, "?", Null)
Form_Current
End Sub

Hope this helps.
Paul Johnson
 
Ah, I missed the point. I thought you wanted the question mark to show up
on the form as well. If you just want a checkbox, the coding is simpler:

Private Sub Form_Current()
Check1 = (Nz([Questionable], "") = "?")
End Sub

Private Sub Check1_AfterUpdate()
[Questionable] = IIf(Check1, "?", Null)
End Sub

Sorry for the confusion.
Paul Johnson
 
Thanks, Paul, works great!

Gary

Paul Johnson said:
Ah, I missed the point. I thought you wanted the question mark to show up
on the form as well. If you just want a checkbox, the coding is simpler:

Private Sub Form_Current()
Check1 = (Nz([Questionable], "") = "?")
End Sub

Private Sub Check1_AfterUpdate()
[Questionable] = IIf(Check1, "?", Null)
End Sub

Sorry for the confusion.
Paul Johnson

Gary Schuldt said:
I want to display a check box chkQ on a form to indicate "Questionable?"
info (or not) to the user.

However, I want to store either a Null or a "?" in the record field txtQ for
ease of display in a downstream (non-Access) program.

What's the best design for this?

My first thought was two controls:

1. chkQ as an unbound check box on the form

2. txtQ as the Text field in the record.

But then I have to write some event handlers to handle both the Change in
chkQ as well as the initial displayed value of it (checked or not) based on
the value of txtQ.

Is there an easier way?

Thanks!

Gary
 
Back
Top