Yes/No field in form: need to change it to string for VBA/SQL

  • Thread starter Thread starter Rachel Garrett
  • Start date Start date
R

Rachel Garrett

How do I turn a Yes/No field into a string?

I have successfully turned numbers and dates into strings that can get
concatenated with the rest of the code, but I cannot find Yes/No
examples. The part where I wrote [[[SOMETHING]]] is where I need to
enter something for Format that will turn Yes/No into a string.

'Turn Milestone Assessed into string (was number from 0 to 5)
Dim strMilAssessed As String
strMilAssessed = Format(Me.Milestone_assessed.Value(), "0")

'Turn Assessment Date into string (was date)
Dim strAssessDate As String
strAssessDate = Format(Me.Assessment_date.Value(), "MM/DD/YYYY")

'Turn Milestone Achieved into string (was Yes/No)
Dim strMilAchieved As String
strMilAchieved = Format(Me.Milestone_achieved_Value(),
[[[SOMETHING]]])

Thank you,
Rachel Garrett
 
I feel silly...I was trying

strMilAchieved = Format(Me.Milestone_achieved_Value(), "Yes/No")

but I kept getting a type mismatch. The problem turns out that I never
went back and changed Me.Milestone_achieved_Value() to strMilAchieved
in the part of the VBA code where the concatentation was taking place.
Now, why didn't I catch that in the first hour or two that I was
trying to squash this bug?
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Back
Top