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...
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...
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...
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...
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
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...
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
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
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...
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...
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...
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
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
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
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 =...
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...
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
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.