From: David W. Fenton on 30 Jan 2010 20:44 Marshall Barton <marshbarton(a)wowway.com> wrote in news:1c19m5t5j2s7f2nk4tss9sai5kfc418psh(a)4ax.com: > David W. Fenton wrote: > >>John W. Vinson wrote >> >>> If you need to allow the field three choices (yes, no, or NULL) >>> then you'll need to use a Number field and some special code to >>> display it as a checkbox. >> >>Uh, the Access checkbox control has the TripleState property to >>allow for just such a setup -- no code required. > > But only if it's bound to a number field. That's obvious, is it not? And besides, John said it already. > A Yes/No field can not be Null. Right. Completely clear from the context. There is still no code required to use a number field and the triple-state checkbox in order to store True/False/Null. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/
From: Marshall Barton on 31 Jan 2010 09:22 David W. Fenton wrote: >Marshall Barton wrote > >> David W. Fenton wrote: >> >>>John W. Vinson wrote >>> >>>> If you need to allow the field three choices (yes, no, or NULL) >>>> then you'll need to use a Number field and some special code to >>>> display it as a checkbox. >>> >>>Uh, the Access checkbox control has the TripleState property to >>>allow for just such a setup -- no code required. >> >> But only if it's bound to a number field. > >That's obvious, is it not? And besides, John said it already. > >> A Yes/No field can not be Null. > >Right. Completely clear from the context. > >There is still no code required to use a number field and the >triple-state checkbox in order to store True/False/Null. Well, David, when you condense it down to it's essence like that, it is perfectly clear, even to me ;-) I guess I was still hung up on emphasizing the OP's Null problem needing a Number type field and your point about no code needed was not at issue. -- Marsh MVP [MS Access]
From: David W. Fenton on 31 Jan 2010 14:11 Marshall Barton <marshbarton(a)wowway.com> wrote in news:i14bm59e027spgh1scstisrp7vs4lhhf4m(a)4ax.com: > David W. Fenton wrote: > >>Marshall Barton wrote >> >>> David W. Fenton wrote: >>> >>>>John W. Vinson wrote >>>> >>>>> If you need to allow the field three choices (yes, no, or >>>>> NULL) then you'll need to use a Number field and some special >>>>> code to display it as a checkbox. >>>> >>>>Uh, the Access checkbox control has the TripleState property to >>>>allow for just such a setup -- no code required. >>> >>> But only if it's bound to a number field. >> >>That's obvious, is it not? And besides, John said it already. >> >>> A Yes/No field can not be Null. >> >>Right. Completely clear from the context. >> >>There is still no code required to use a number field and the >>triple-state checkbox in order to store True/False/Null. > > Well, David, when you condense it down to it's essence like > that, it is perfectly clear, even to me ;-) > > I guess I was still hung up on emphasizing the OP's Null > problem needing a Number type field and your point about no > code needed was not at issue. Well, you'll note I wasn't responding to the original poster's problem, but to a particular sentence written by John. That's why I quoted only that part. No matter -- I do this all the time, i.e., reading a posting in a different context than the post was written, even when the poster makes very clear what is being addressed (as I think I did). -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/
From: John W. Vinson on 31 Jan 2010 16:32 On 30 Jan 2010 17:05:47 GMT, "David W. Fenton" <XXXusenet(a)dfenton.com.invalid> wrote: >> If you need to allow the field three choices (yes, no, or NULL) >> then you'll need to use a Number field and some special code to >> display it as a checkbox. > >Uh, the Access checkbox control has the TripleState property to >allow for just such a setup -- no code required. Quite correct. Sorry for the error on my part. -- John W. Vinson [MVP]
From: Afrosheen via AccessMonster.com on 31 Jan 2010 19:03
Ok. Thanks for all your replies. Now to get back to the problem at hand. First I want to say that I messed up. It is NOT a yes/no field. It is a text field that needs to change [Super1]. The yes/no field [SupMan]is a check box to basically say that if it is checked then this person is a supervisor. If it is not checked then the person is not a supervisor and then supposed to find all employees that has the supervisor id and change them to Null or make it empty. And It still does not work. It leaves the information in the [Super1] field. I modified the code a little bit to make sure that the [supman] is false. 20 If SupMan = False Then txtAssist1 = StaffId 60 Set dtm = CurrentProject.AccessConnection sql6 = "Update tblMain set super1 = Null where super1 =""" & txtAssist1 & """ And Not (tblMain.SupMan) = true" '70 sql6 = "Update tblMain set super1 = False where super1 =" & txtAssist 80 dtm.Execute sql6, adCmdText + adExecuteNoRecords 90 Set dtm = Nothing 100 End If Thanks for all your input. John W. Vinson wrote: >>> If you need to allow the field three choices (yes, no, or NULL) >>> then you'll need to use a Number field and some special code to >>> display it as a checkbox. >> >>Uh, the Access checkbox control has the TripleState property to >>allow for just such a setup -- no code required. > >Quite correct. Sorry for the error on my part. -- Message posted via http://www.accessmonster.com |