Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rachel Garrett - 27 May 2008 17:54 GMT
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
Rachel Garrett - 27 May 2008 18:01 GMT
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 - 27 May 2008 20:52 GMT
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 - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
Chris O'C - 27 May 2008 21:04 GMT
At least Jan will be back in time for the election!

Chris
Microsoft MVP

>Jan Baird is out of the country until September 20.   Every effort will be
>made to respond to messages, but please be patient.
Tom Brown - 27 May 2008 22:13 GMT
Which election???

> At least Jan will be back in time for the election!
>
[quoted text clipped - 3 lines]
>>Jan Baird is out of the country until September 20.   Every effort will be
>>made to respond to messages, but please be patient.
Chris O'C - 27 May 2008 23:38 GMT
The one on Nov. 4, 2008.

Chris
Microsoft MVP

>Which election???
>
[quoted text clipped - 3 lines]
>>>Jan Baird is out of the country until September 20.   Every effort will be
>>>made to respond to messages, but please be patient.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.