Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Any VB/VBA gurus here tonight?

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Catch22Dem Donating Member (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.
Printer Friendly | Permalink |  | Top
Ready4Change Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Aug-20-05 08:42 PM
Response to Original message
1. My thoughts.
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?
Printer Friendly | Permalink |  | Top
 
LynzM Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Aug-20-05 08:47 PM
Response to Original message
2. Or....
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...
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Dec 26th 2024, 09:32 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC