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

Connecting Form to Microsoft example module

Status
Not open for further replies.

JPep

Programmer
Dec 28, 1999
11
US
I tested the Microsoft article &quot;How to Fill a Table with Random Records from another table&quot;, see link below.&nbsp;&nbsp;It works great! However, I am trying to automate how to enter the number of records to fill in a table.&nbsp;&nbsp;The example has it all contained in the module.&nbsp;&nbsp;Where the first line is &quot;Sub BuildRandomTable(lngRequest As Long)&quot; and to run it you need to be in the debug window and type &quot;BuildRandomTable&quot; followed by the number of records you want. I would like to enter the number on a form and just click a button to run the module.&nbsp;&nbsp;I am having trouble with setting &quot;lngRequest&quot; to the unbound text box I set up to enter the number of records.<br><br>Any suggestions?&nbsp;&nbsp;<br>Here is the link:<br><A HREF=" TARGET="_new">
 
Try this code attached to MyButton on the form with NumberOfRecords as the name of the unbound textbox<br><br><FONT FACE=monospace><br>Sub MyButton_Click()<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Call BuildRandomTable(NumberOfRecords)<br><br>End Sub<br></font> <p>Jim Conrad<br><a href=mailto:JimConrad@Consultant.com>JimConrad@Consultant.com</a><br><a href= > </a><br>
 
Thank you that is all I needed!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top