Hi, I want to preface this post by saying how much I appreciate this community. I haven't contributed much, but my access knowledge is apprentice level at best, hopefully that will change. Thank you.
My current project is a gene sequence database to store experiment/extraction results. The post-doc i'm designing for has very specific ideas about how she wants to do data entry. The forms have to be very user friendly.
Right now I'm struggling with making dynamic controls on a form. At the top of the form would be two text boxs where a range of specimen ID's would be entered (eg 20-30). After clicking a command button, below would appear on the form 10 sets of controls, like so:
textbox optiongroup checkbox
one for each ID in the range specified above. The meat of my problem is creating these controls.
There are several work around options, but i'm trying to avoid them for now. These include solutions like making 100 of these control groups invisible, then setting some them to visible after the range is specified.
I've found the "createcontrol" method, which lets you add controls to a form, like so
and presto. So i can create 1 control, and it's name would be txtID. but I don't know how many i want to create. The only solution I can see is the incredibly ugly brute force method of
Ideally there is some sort of array or collection solution, but I don't know enough to figure it out.
Any suggestions are more than welcome!!!
My current project is a gene sequence database to store experiment/extraction results. The post-doc i'm designing for has very specific ideas about how she wants to do data entry. The forms have to be very user friendly.
Right now I'm struggling with making dynamic controls on a form. At the top of the form would be two text boxs where a range of specimen ID's would be entered (eg 20-30). After clicking a command button, below would appear on the form 10 sets of controls, like so:
textbox optiongroup checkbox
one for each ID in the range specified above. The meat of my problem is creating these controls.
There are several work around options, but i'm trying to avoid them for now. These include solutions like making 100 of these control groups invisible, then setting some them to visible after the range is specified.
I've found the "createcontrol" method, which lets you add controls to a form, like so
Code:
dim txtID as TextBox
set txtID = CreateControl("formname", acTextBox)
and presto. So i can create 1 control, and it's name would be txtID. but I don't know how many i want to create. The only solution I can see is the incredibly ugly brute force method of
Code:
dim txtID1 as TextBox
dim txtID2 as TextBox
...
dim txtID100 as TextBox
if (range > 0) then
set txtID1 = CreateControl("formname", acTextBox)
end if
if (range > 1) then
set txtID2 = CreateControl("formname", acTextBox)
end if
...
if (range > 99) then
set txtID100 = CreateControl("formname", acTextBox)
end if
if (range > 100) then
msgbox "Too many ID's specified."
end if
Any suggestions are more than welcome!!!