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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get some information

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
Ok, so I have a little VB script I run... I think Access is calling it a module. It does work on a table, messing with some fields and everyone goes home happy.

Except as it stands, everytime I want to apply the script to a different table I have to modify my one line of code that says table = "xxxxx", field = "xxxxx"

Now, two part question...

Is there a way to have my program recognize the active table, and default to it? (some kind of environment variable that just has the name of the active table)

If not, or even if so for my field variable... how do I pop up a little text box so people can enter the information there rather than having to change a line of the code each time... rather how do I pop it up and then extract the information from it... I think I know how to just pop it up.

Thanks,
Rob
 
Hi

At its simplest:

InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])

would do what you want, but if you wanted to verify / prevent mistakes then a Form with Combo boxes for Tables and Fields would be more user friendly. You can populate the list of table names from the tabldefs collection, and the lsit of column names for each table from the fields collection of the relevant tabledef

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top