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

Search results for query: *

  1. TGandon

    Tree View

    Jack(?) I work as a software developer on Southern Water's SCOPE. PI and CMS databases so may have some insight into what you are doing. Can you explain a bit more about what you are trying to achieve (e.g. recordset contents and/or query SQL). I'm guessing that you're trying to populate a...
  2. TGandon

    Check for program running and notify user

    Add the following to a module '***************************************** ' Windows API function declarations '***************************************** Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _ ByVal wCmd As Long) As...
  3. TGandon

    Treeview and Directory

    Private Sub cmdTest_Click() Dim I As Integer For I = 0 To FileListBox1.ListCount - 1 TreeView1.Nodes.Add , , FileListBox1.Tag, FileListBox1.List(I) Next End Sub Bearing in mind that the key assigned to each node must be unique so using FileListBox1.Tag will raise a "Key Is Not Unique In...
  4. TGandon

    ADO recordsets

    If you import the data into Access, accepting all defaults, you will see that a primary key is prepended to the data and the second column is interpreted as a long integer data type. Access therefore treats all second column values as null where the value is invalid as a long. i.e. The third...
  5. TGandon

    Run-time error 383. 'Text' property is readonly

    According to MSDN, Error 383 applies to "the Windows Common Controls located in the MSComctl.OCX file". Are you absolutely sure it's a richtextbox that's causing the problem and not a combobox with its style set to "Dropdown List"? Trevor
  6. TGandon

    CNC machine text dump --> Database using VB

    Here is an initial suggestion using a timer control and reading blocks of data from the file. Edit the constants to suit. Option Explicit Const CNC_TEXT_DUMP As String = "C:\MyFolder\MySubFolder\CNCDUMP.TXT" Const MAX_BUFFER_SIZE As Long = 16384 Const MIN_SIZE_INCREASE As Long = 256 Dim...
  7. TGandon

    need to check string if its Date or not

    If IsDate(strDate) Then strDate = Format(strDate,"mm-dd-yy") End If Trevor
  8. TGandon

    Relationships? Cascading deletion.

    Sorry about that. I was working from home and only had access to SQL 7 books online. Even so I would still advise caution in using it. I find that having to explicitly delete "child" records prior to the "parent" ensures that I cannot inadvertently delete the "parent" if it has "children". Trevor
  9. TGandon

    Relationships? Cascading deletion.

    SQL Server does not have an equivalent to the MS-Access Cascade Delete. You can explicitly "DELETE FROM PersonnelPersonalInfo WHERE UserId = x" followed by "DELETE FROM PersonnelCoreInfo WHERE UserId = x" Or create a stored procedure to which you pass the UserId and it performs the deletes Trevor
  10. TGandon

    Relationships? Cascading deletion.

    This error occurs because you have your relationship the wrong way round. i.e. Each record in PersonnelCoreInfo would be dependant on a related record in PersonnelPersonalInfo, but PersonnelPersonalInfo has no data and PersonnelCoreInfo has. If you are creating the relationship using a diagram...
  11. TGandon

    Treeview Duplicates

    I assume from your post that you are not assigning a key to the nodes as you add them. I would advise doing so as it makes checking far easier. For example ' To add a root level node (User) If Not IsNode(UserName As String) Then Tree1.Nodes.Add , , UserName, UserName End If ' To add a...
  12. TGandon

    Timers not working when minimized - why?

    I've just created a new project, single form with a single timer on it (100 interval) with code Private Sub Timer1_Timer() Static intCtr As Integer intCtr = (intCtr + 1) Mod 10 If intCtr = 0 Then Me.Caption = Time End If End Sub When minimized the timer still fires. Are you sure your...
  13. TGandon

    I can't use an SQL INSERT statement

    Carlos, Your program requires an object library reference. Go to Project -- References then scroll down and tick the "Microsoft DAO x.x object library" Trevor
  14. TGandon

    Opening an Excel file in Access VBA

    This may be irrelevant but I had a similar problem using Excel 97 on XP. The solution was to download and install the Office 97 service releases 1 & 2 from Microsoft. Trevor
  15. TGandon

    Check for lost SQL connection

    For an "occasional" check you could just send a simple query that has a known result such as "SELECT COUNT(*) FROM MyTable" (i.e. returns a single column, single row) Then if an error occurs you can explicitly close the connection and try to re-open it. Trevor
  16. TGandon

    Parsing String Question

    Four methods off the top of my head (untested) Option 1.Dim Words()As String Words = Split(StringA, vbTab) StringB = Words(Ubound(Words)) Option 2.StringB = StringA Do While Instr(StringB, vbTab) StringB = Mid(StringB, Instr(StringB, vbTab) + 1) Loop Option 3.Dim Ptr As Integer Ptr =...
  17. TGandon

    Populating TreeView

    Shaun You can put in a simple check usingPublic Sub NodeExists(ByRef Tree As TreeView, ByVal Key As String)As Boolean On Error Resume Next ' If Tree.Nodes(Key) doesn't exist, error occurs and function returns false NodeExists = (Tree.Nodes(Key).Text <> "") End Function Then in your...
  18. TGandon

    Open an existing .ppt powerpoint file from Visual Basic 6

    I meant to say that whatever happens, Powerpoint has to "open" but as HarlyQuinn says This is the default when using Set objPPt = New Powerpoint.Application If you wanted it to be seen you would just addobjPPt.Visible = True Trevor
  19. TGandon

    Open an existing .ppt powerpoint file from Visual Basic 6

    When you say I don't see how you can easily achieve this. Unless I am totally wrong, you need PowerPoint to interpret the file data (in the same way as if you try to load an Excel file into a textbox you end up with rubbish). You can load Powerpoint in the background by setting a reference to...
  20. TGandon

    Modal form load

    I agree with Bob about using the Forms collection. I guess the point I was trying to make was that if FormEdit is only ever used modally then the If FrmEdit.Visible Then Unload FormEdit is irrelevant because the only time it is visible is when you show it. i.e. code execution in the calling...

Part and Inventory Search

Back
Top