Catch22Dem
(1000+ posts)
Send PM |
Profile |
Ignore
|
Sat Aug-20-05 08:32 PM
Original message |
Any VB/VBA gurus here tonight? |
|
I'm a ColdFusion/JavaScript programmer & MSSQL database developer, but I'm trying to create a small access db for a friend, and I really don't have any VB skills. Perhaps one of you can help.
I have a textbox on an Access form where the user is to type in a number. What I want to do is use the number they type in to create that many text boxes. Think of it this way...I want them to type in the number of tracks on a CD, which will then create that many text boxes where they type in the song names. How do I handle those events. The song names would then of course go into a table.
Feel free to talk to me like a programmer, but I have a fairly decent grasp of VB/VBA syntax, but I really don't know the methods.
Any help is greatly appreciated.
|
Ready4Change
(1000+ posts)
Send PM |
Profile |
Ignore
|
Sat Aug-20-05 08:42 PM
Response to Original message |
|
Load the number they enter into a variable, and use that to control the number of times you pass through a looping structure. Each time you pass, create a new text window. I've not done any VB, but I assume there is something like a Do/While command?
|
LynzM
(1000+ posts)
Send PM |
Profile |
Ignore
|
Sat Aug-20-05 08:47 PM
Response to Original message |
|
Edited on Sat Aug-20-05 08:48 PM by LynzM
(And this will make a lot of extra fields that you may not want around taking up space... but if that's not a worry)
Set a maximum. Create that many boxes, and have them 'hide' each time the form loads or a new record is created. (.visible = false, I think. Been a while) Enable each one to be visible as applicable, naming each box something you could iterate through in a loop... (txtBox1, txtBox2,etc.) so that you could plug the loop variable value into part of the textbox name. (or write a really big If/then chunk of code to enable the correct number of boxes to be visible).
Clunky, but would work in a pinch if you don't get any better ideas. Also would be easier to set up the table to base the form on, if the number of fields isn't dynamic, just the number used...
|
DU
AdBot (1000+ posts) |
Wed Apr 24th 2024, 10:24 AM
Response to Original message |