A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

change textbox to checkbox



 
 
Thread Tools Display Modes
  #1  
Old April 3rd, 2010, 01:50 AM posted to microsoft.public.access.forms
Keith G Hicks
external usenet poster
 
Posts: 130
Default change textbox to checkbox

I have a form with over 80 text boxes on it. They should be checkboxes.
Rather than plopping 80+ checkbox objects on the form and manually assigning
labels, checkbox names and sources I would like to figure out how to edit
the source. In Delphi I can edit the source file VERY easily and change text
boxes to checkboxes lickity split. Piece of cake. Ugh. I hate mdb's for this
reason. I can right click a text box and change it to a combo box but the
option to change to a checkbox is grayed out. Again, ugh. So is this
possible or am I stuck spending an hour or so mucking my way through this
manually???

Thanks,

Keith

Oh, and it's an ADP, not an MDB to be exact. But a forms a form, right? The
problem is that I can't find a hidden/ssytem table that has this info in it.


  #2  
Old April 3rd, 2010, 02:07 AM posted to microsoft.public.access.forms
Keith G Hicks
external usenet poster
 
Posts: 130
Default change textbox to checkbox

The only thing I can think of is to add the checkboxes to the form
programatically but I'm getting nowhere with that. All the posts out there
where people ask how to do this are answered with "YOu should not do that".
What a crock. Sometiems there is a reason for somethign that someone else
might not understand. I can see why it might be a bad idea to do this on a
regular basis with the same form over and over again but that's not what I'm
doing. I need to add these only once and then the form is done. Can someone
show me how to do this or point me to where it's shown?

Thanks,

Keith

"Keith G Hicks" wrote in message
...
I have a form with over 80 text boxes on it. They should be checkboxes.
Rather than plopping 80+ checkbox objects on the form and manually
assigning labels, checkbox names and sources I would like to figure out how
to edit the source. In Delphi I can edit the source file VERY easily and
change text boxes to checkboxes lickity split. Piece of cake. Ugh. I hate
mdb's for this reason. I can right click a text box and change it to a
combo box but the option to change to a checkbox is grayed out. Again, ugh.
So is this possible or am I stuck spending an hour or so mucking my way
through this manually???

Thanks,

Keith

Oh, and it's an ADP, not an MDB to be exact. But a forms a form, right?
The problem is that I can't find a hidden/ssytem table that has this info
in it.



  #3  
Old April 3rd, 2010, 02:37 AM posted to microsoft.public.access.forms
Keith G Hicks
external usenet poster
 
Posts: 130
Default change textbox to checkbox

Never mind. I figured it out.


Dim frm As Form
Dim ctlChk As Control
Dim ctlChkTop As Double
Dim ctlLbl As Control
Dim ctlLblTop As Double

DoCmd.OpenForm "frmEditHolidayDates_subform", acDesign

Set frm = Forms("frmEditHolidayDates_subform")

ctlChkTop = 1.2292
ctlLblTop = 1.2083

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "SELECT County FROM tblCounties WHERE County '*** UNKNOWN
COUNTY' ORDER BY County", cnnCurrProj, adOpenStatic
While Not rs.EOF

Set ctlChk = CreateControl(frm.Name, acCheckBox, acDetail, ,
rs!County, 0.7083 * 1440, ctlChkTop * 1440)
Set ctlLbl = CreateControl(frm.Name, acLabel, , ctlChk.Name,
rs!County, 0.8681 * 1440, ctlLblTop * 1440)

rs.MoveNext

ctlChkTop = ctlChkTop + 0.2292
ctlLblTop = ctlLblTop + 0.2292
Wend




  #4  
Old April 3rd, 2010, 03:34 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default change textbox to checkbox

On Fri, 2 Apr 2010 20:50:15 -0400, "Keith G Hicks" wrote:

I have a form with over 80 text boxes on it. They should be checkboxes.


Ummm... probably not!

They should almost certainly be ONE control in 80 records in a related table.

What are your tables? How are they related?

Rather than plopping 80+ checkbox objects on the form and manually assigning
labels, checkbox names and sources I would like to figure out how to edit
the source. In Delphi I can edit the source file VERY easily and change text
boxes to checkboxes lickity split. Piece of cake. Ugh. I hate mdb's for this
reason. I can right click a text box and change it to a combo box but the
option to change to a checkbox is grayed out. Again, ugh. So is this
possible or am I stuck spending an hour or so mucking my way through this
manually???


It depends on what is in the checkbox. A checkbox allows only two choices: -1
for True, 0 for False. If the textbox contains text strings like "Yes" or
"No", it won't allow that choice.

Thanks,

Keith

Oh, and it's an ADP, not an MDB to be exact. But a forms a form, right? The
problem is that I can't find a hidden/ssytem table that has this info in it.


It's a flawed table design, whatever frontend you're using.
--

John W. Vinson [MVP]
  #5  
Old April 3rd, 2010, 03:35 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default change textbox to checkbox

On Fri, 2 Apr 2010 21:37:26 -0400, "Keith G Hicks" wrote:

Never mind. I figured it out.


I'm glad you found a way to dig yourself deeper into your flawed design to
your satisfaction, and I apologize for offering to help.
--

John W. Vinson [MVP]
  #6  
Old April 3rd, 2010, 04:03 AM posted to microsoft.public.access.forms
Keith G Hicks
external usenet poster
 
Posts: 130
Default change textbox to checkbox

What a shmuck. My "Never mind. I figured it out" was posted a good hour
before your attempt at a solution. I never cease to be amazed at how
obnoxiuos and unkind folks can be in the MS newsgroups. You don't know
enough about what I'm doing to make that judgement. I'm sorry you *tried* to
help as well. If you've nothing constructive to say, don't bother. I spent a
lot of time in the Borland Delphi newsgroups a few years ago on a big
project. It was like a breath of fresh air. 99% of the people there were
genuinely kind and helpful no matter what you were trying to do. And if they
felt that you could do something a little more efficiently, they didn't feel
the need to be rude about it.


"John W. Vinson" wrote in message
...
On Fri, 2 Apr 2010 21:37:26 -0400, "Keith G Hicks"
wrote:

Never mind. I figured it out.


I'm glad you found a way to dig yourself deeper into your flawed design to
your satisfaction, and I apologize for offering to help.
--

John W. Vinson [MVP]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.