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

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
 
R

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?
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
C

Chris O'C via AccessMonster.com

At least Jan will be back in time for the election!

Chris
Microsoft MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top