change textbox to checkbox

  • Thread starter Thread starter Keith G Hicks
  • Start date Start date
K

Keith G Hicks

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.
 
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
 
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
 
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.
 
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.
 
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.
 
Back
Top