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

SQL

Status
Not open for further replies.

stallion

Programmer
Feb 22, 2000
14
GB
ok, thanks for taking the time to read this, i am not that experienced with basic so could you keep your answers simple please. I have a access 97 table with the following fields:<br>
-Expense, ie. postage, travelling expenses(text)<br>
-Cost(currency) <br>
-Month(text)<br>
How would i use VB6 to create an interface that would let me sum the cost of the expenses for a certain month eg the amount spent in February on travelling. Should the SQL be linked to a command button and the result shown in a text box?<br>
<br>
Please remember that i am not as experienced with VB6 so simple answers please!<br>
<br>
THANK YOU<br>

 
Well the easiest way to &quot;Access&quot; data is use the DataConnector<br>
In VB 6 there is a wizard that will link directly to Access tables or queries without code.<br>
I'd explore this rout first before delving into code.<br>
then you can add code if you like to do other things.<br>
Click &quot;Add-Ins&quot; then &quot;Add-in Manager&quot; <br>
look for &quot;VB 6 Data form Wizard&quot;<br>
Now in the lower right click the &quot;load/unload&quot; box and &quot;load at startup&quot;<br>
then click &quot;OK&quot;<br>
Clci the add-in menu again and you will see a new item called &quot;Data Form Wizard&quot;<br>
<br>
Click it and you are on your way to adding data to your form.<br>
<br>
<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Hi, i can understand the adding and deleting of records but i am more concerned with the search function i explained in my original question.
 
OK, <br>
SQL = &quot;Select * From MyTable Where Month = &quot; & txtMonth & &quot; And Traveling = &quot; & txtTravel <br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
also, this will probably sound dumb to you but how would i display the answer to the SQL statement?
 
you have labels that are linked to the field using the field source property.
 
sorry everyone i am still not getting it:<br>
<br>
- you have a command button which contains the sql, when pressed how will i make the answer appear in a label, could you also explain it so i understand it<br>
THANKS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top