Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastest way to make 2 Yes No Buttons for MANY fields on a form

Status
Not open for further replies.

northernbeaver

Programmer
Jul 9, 2001
164
CA
I have 3 tables with about 40 Yes/No fields in each - the client would like a seperate option button for yes and no so the user has to select one or the other, I know I can do this by making option groups but doing the wizard 120 times is going to take a while, is there a faster way I can get this done?

thanks

 
Sounds like you have a poorly designed database!

120 Yes/No fields in flat file tables?

Not good.

Care to post what it is being used for?

Sean.
 
its a Government form that they want to make electronic, the user will fill out the 120 yes no questions then print a report to pdf and give the report to the end user to keep and follow.
 
Good advice above, but if that doesn't fit your situation, then the following sub should serve as a template. Its easiest to run from a command button on a form (other than destination form).

Set the positions, number of controls and destination form name. Note that the destination form must be open in design view.

Cheers, Bill

Dim frm As Form
Dim ctlCheck As Control
Dim intX As Integer
Dim intY As Integer
Dim iCtr As Integer
Dim strFormName as string
strFormName = "Form2"
intX = 1000
intY = 100
iCtr = 10
Set frm = Forms(strFormName) ' destination form (must be open in design view)
Do While iCtr > 0
' Set positioning values for new controls.
intY = intY + 200
' Create controls.
Set ctlCheck = CreateControl(frm, acCheckBox, acDetail, , , intX, intY)
iCtr = iCtr - 1
Loop
 
Have you thought about using arrays?

Ian Mayor (UK)
Program Error
Programming is 1% coding, 50% error checking and 49% sweat as your application bombs out in front of the client.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top