×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

another vb question

another vb question

another vb question

(OP)
the tutorial i am going through is makes a user form with one combo box and two command buttons.

The combo box is a drop down menu that allows you to pick the material and the code matches that material with the appropriate density.

The two command buttons are "OK" and "cancel".


The code works fine but I am having trouble with the procedure for the OK command where it is supposed to convert the density from lbs/in^3 to kg/m^3

here is the procedure for the "OK" command button.

Private Sub cmdOK_Click()
Dim density As Double
'The required density is in kg/m^3
'so multiply by a scale factor
density = frmMaterials.cboMaterials.Column(1, frmMaterials.cboMaterials.ListIndex) * 27680
Part.SetUserPreferenceDoubleValue(swMaterialPropertyDensity, density)
End
End Sub

I get an error in the row that starts off with density.
Can someone help
thanks,


RE: another vb question

Whats the error? Difficult to tell without seeing the form. Have you tried another set of brackets as below?
density = frmMaterials.cboMaterials.Column((1, frmMaterials.cboMaterials.ListIndex) * 27680)

Dunno if this will help.

RE: another vb question

Taz,

What version of SW are you using? If older than 2006, there may be functions that are not supported.  Also, it is difficult to answer your question without more details, as suggested by the Doctor's nemesis above.

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
http://sw.fcsuper.com/index.php

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources