Search:
Type: Posts; User: MarkT
Search:
Search took 0.50 seconds.
-
As pointed out, an array of textboxes would be your friend. Then something like this.
Option Explicit
Dim strInitValue(5) As String
Private Sub Form_Load()
Dim i As Integer
For i = 0...
-
It seem I did this many years ago in VB6 but can find an easy method in C#. Anyways, I’m try to save and retrieve options from a database as a single value. For this example I’ll use colors since...
-
What he said. I clicked on your post and when I saw one line question and an attachment I wasn't going any further.
-
You could try attaching the project so we can see what is going on.
-
Yes, I missed no break statement.
-
Doesn't this code have the chance of getting caught in an endless loop? If charCodeAt = 13 and then next charCodeAt <> 10 then the loop counter is never updated and you're stuck.
-
In the OP there was no code that needed to be skipped after the k loop.
-
When I've had nested for loops that I needed to escape the outer loop I've just set the outer loop variable beyond the limit of the to statement.
Private Sub Command1_Click()
For i =...
-
I know OP has a solution but it has been so long since I did anything in VB6 I thought I would take a stab at it. I have no idea of speed but this is what I came up with.
Option Explicit
...
-
Yes, but in this case he says it never makes it inside the if statement and there is no other exit condition in his loop. In the code OP supplied, I see no other options.
-
There are only way that I can see the n=2 after the loop finishes is if UBound of SquaresAroundTarget equals 1.
-
It's been a while since I've played in VB6 but my gut reaction is why not ADO? I may be a little off on the syntax but it should be pretty close. Of course you still need to declare and instantiate...
-
Reading through the posts, I was wondering why InStr was the choice over splitting the string.
-
I think the problem is in the last check
If blnSafe = True Then
Label.Caption = "Safe"
End If
It only sets the label if you're safe. It doesn't clear the label if unsafe.
If blnSafe =...
-
Exit For is making the code drop out of the loop after it finds the first textbox that is not empty. Remove that line and see if you get the desired results.
-
Probably more efficient ways of doing it but I used to do something like this when I need to randomly shuffle something.
Private Sub Command1_Click()
Dim i As Integer
Dim col As Collection
Dim...
-
I don't know if Luca doesn't use control arrays because this is VBA and it is a limitation but in VB6 (not sure about VBA) you can iterate through the controls collection and set the text of a...
-
Another option would be populate just the names from the database and the add the additional prompt to the combobox.
'Code to populate users from database
'Add a prompt as the first...
-
Anything?
MsgBox CalendarControl.DayView.GetCellNumber(Now)
-
The function is expecting a date object. By using format, you are turning Now which is already a valid date object into a string.
-
Any reason for wanting to use an array? Wouldn't a simple replace work.
findInvChars = (Date & " " & Time)
findInvChars = Replace(findInvChars, ":", "/")
findInvChars =...
-
Pretty straight forward using the filesystemobject
Private Sub Command1_Click()
Dim fso As FileSystemObject
Dim fld As folder
Dim strStartingDir As String
Set fso = New FileSystemObject...
-
Few thoughts...
Right now it is unclear where goto VBSTOP takes you. I assume that it is bailing out of the loop. But even if it does, if you have 100,000 records in the Customers table and VBSTOP...
-
Give something like this a try.
Private Sub txtDollar_Change()
SumAll
End Sub
Private Sub txtFiftyCents_Change()
SumAll
End Sub
-
The quick and dirty way to do it would be using a timer.
Option Explicit
Dim m_ActiveControl As Control
Private Sub Form_Load()
Timer1.Interval = 50
Timer1.Enabled = True
End Sub
-
Not sure what you are trying to accomplish but the check in you button is always going to tell you to "Put cursor in text field". As soon as you click your button, the active control becomes the...
-
In English, what does that error say?
Never mind. I see the problem.
In the Make_Word sub, comment out the line that is causing the error.
Combo3 will not be populated until after an Item in...
-
See if this get you there
Dim DB As New ADODB.Connection
Dim RS As New ADODB.Recordset
Private Sub Form_Load()
DB.Provider = "Microsoft.JET.OLEDB.4.0;"
DB.Open App.Path & "\MADA.mdb...
-
Can you attach a sample project that's working with what you have so far?
-
I would think this would work
Private Sub List1_DblClick()
Dim sShellLine As String
Dim ret As Long
MovieName = List1.List(List1.ListIndex) & "\VIDEO_TS.IFO"
MovieName = "D:\DVD...
-
"""F:\Movies\16 Blocks\VIDEO_TS\VIDEO_TS.IFO"""
Do you really need to warp this in quotes. Would this work
"F:\Movies\16 Blocks\VIDEO_TS\VIDEO_TS.IFO"
Either way, I have to believe that when...
-
The ShellExecute() function returns the value 31 if there is no association for the specified file type. With that I find it hard to believe that on the machine where you are having this issue that...
-
There must be some details we aren't getting here. If you can double click on the VIDEO_TS.IFO in windows explorer and it opens and "D:\DVD Movies\Dark Country\VIDEO_TS.IFO" is the proper full path...
-
That's why people are suggesting ShellExecute instead of Shell.
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
...
-
ShellExecute is what you want. It will use the default application associated with the file extension to open the selected file. You will however need the full path to the file you are intending to...
-
You could also try the Locals Window to see the values of your array.
140315
-
If you run this you see the difference in what is being sent to the shell command.
Private Sub Command1_Click()
Dim msReportPath As String
Dim sCookie As String
Dim msServer As String
Dim...
-
Every comma you have in the shell command is being interpreted as parameter separator. So in your case it looks like you are passing the exe with an sCookie (command) parameter. Then the shell...
-
You have way to many parameters in there for the shell function. The shell function accepts up to 2 parameters. The path of the exe is required and then there is the optional window style parameter....
-
What you really need to understand is what Data suggested. If you just did this one thing it would probably greatly reduce the amount of assistance you needed.
|
Click Here to Expand Forum to Full Width
|