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!

Help Adding to my VBA Code

Status
Not open for further replies.

TJVFree

Technical User
Nov 22, 2010
236
US
I'm hoping someone can help me all to this code. I need this code to say something like this in within the VBA script.

If the field has a "0" or false act like the field is not there. in other words, I don’t want to us a field with a "0" or a "false" in my standard deviation calculation.

Thank you

Code:
Public Function GetXLStDev(No1 As Double, No2 As Double, No3 As Double, No4 As Double, No5 As Double, No6 As Double) As Double
   Dim objExcel As Object
   Set objExcel = CreateObject("Excel.Application")
   
     
   Let GetXLStDev = objExcel.StDev(No1, No2, No3, No4, No5, No6)
   
   objExcel.Quit
   Set objExcel = Nothing
End Function

Public Function Pause(PauseSeconds As Double)

Dim Start
Start = Timer
Do While Timer < Start + PauseSeconds
DoEvents
Loop

End Function
 
What's wrong with the answers you are getting in thread701-1635922? Clearly your fields are text but should be numeric. In addition, your table structure appears to be highly un-normalized. From what I have seen, your application might as well be in Excel.

Duane
Hook'D on Access
MS Access MVP
 
If you write your own Standard Deviation function like I suggested in your other post, then you can check each variable as you are doing the calculation, and only include the valid ones.
 
Duane /JoeAtWork, I was able to get the VBA code to work!!!! Thank you both so much for staying with my and helping me get this code to work. This is awesome. I hope you both know how much you’ve help me and everyone else that needs help in this form, you guys ROCK!!!.

Thank you, thank you, and thank you
TCB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top