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

Access/Visual Basic...how?

Status
Not open for further replies.

DJKAOS

Technical User
Jun 30, 2000
101
US
My formulas are getting to complicated and its getting hard to get things the way I wan't.&nbsp;&nbsp;How can I type some Visual Basic code and have it put the result into an access edit box?<br><br>I know enough of VB I have made some programs in it, I just don't know how to hook the modules to access.&nbsp;&nbsp;<br><br>Side note...any way to use C++ for this?&nbsp;&nbsp;I know it more than anything.
 
go to the module tab <br>click new<br>type in the sub or function name and add parenthesis and your on your way<br><br>if you want to set a field in a table equal to something<br>you use the edit command<br><br>Dim db as database, recset as recordset<br><br>set db = dbengine.workspaces(0).databases(0)<br>set recset = db.openRecordset(db_open_dynaset)<br><br>recset.findfirst &quot; [name of field to find on] = 'value to find' &quot;<br>recset.Edit<br>recset![field name to change value] = value to change to<br>recset.Update<br><br>I hope this works better. I don't know why the average did not work.<br><br><br> <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
Hmmm.<br><br>If your formulas (algorithms) are already written in C or C++ why not create a DLL that Exports those Functions? Maybe a couple of exported functions that take arguments and return simply the results? <br><br>You're probably already familure with creating DLL's. So just create the appropriate export information and compile the guy. The actual Physical location of the DLL is a consideration, and there are several options. Simplest one is to place it in the same folder as the Program that will be using it.<br><br>You can use both Access and VB to call the exported functions by Declaring the functions in one of the modules.&nbsp;&nbsp;Check the VB or Access reference on Declaring DLL functons. You'll have to look at the reference as regards passing arguements between the modules (everything gets passed 'ByVal<i>ue</i>' from VB/VBA),; this is the biggest part of it. <br><br>Here's a neat bit of information:<br><A HREF=" TARGET="_new"> ? Let me Know. <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top