Search:

Type: Posts; User: MarkT

Page 1 of 13 1 2 3 4

Search: Search took 4.11 seconds.

  1. Replies
    8
    Views
    1,059

    Re: A Better Way To Do This?

    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...
  2. Replies
    0
    Views
    510

    How to compare a saved number

    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...
  3. Thread: Array problems

    by MarkT
    Replies
    8
    Views
    1,249

    Re: Array problems

    What he said. I clicked on your post and when I saw one line question and an attachment I wasn't going any further.
  4. Replies
    58
    Views
    8,189

    Re: need 2 decimal places

    You could try attaching the project so we can see what is going on.
  5. Re: Text parser written in VB6 are thousands of times slower than JavaScript.

    Yes, I missed no break statement.
  6. Re: Text parser written in VB6 are thousands of times slower than JavaScript.

    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.
  7. Replies
    20
    Views
    1,541

    Re: [RESOLVED] Exiting a Nested For/Next Loop

    In the OP there was no code that needed to be skipped after the k loop.
  8. Replies
    20
    Views
    1,541

    Re: [RESOLVED] Exiting a Nested For/Next 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 =...
  9. Re: Quickest way to populate treeview from table of data (MS or Krool's VBCCR)

    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
    ...
  10. Replies
    30
    Views
    3,601

    Re: Don't understand For...Next loop

    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.
  11. Replies
    30
    Views
    3,601

    Re: Don't understand For...Next loop

    There are only way that I can see the n=2 after the loop finishes is if UBound of SquaresAroundTarget equals 1.
  12. Replies
    12
    Views
    2,277

    Re: Issue with parsing

    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...
  13. Re: Textbox scan of word and the word following that word

    Reading through the posts, I was wondering why InStr was the choice over splitting the string.
  14. Replies
    11
    Views
    1,492

    Re: Do While Loop True/False check doesn't work

    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 =...
  15. Replies
    3
    Views
    3,002

    Re: Iterate Through textboxes

    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.
  16. Replies
    11
    Views
    5,300

    Re: Random Number, no duplicates

    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...
  17. Replies
    10
    Views
    1,552

    Re: Assign dinamyc value to tetxtbox

    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...
  18. Replies
    28
    Views
    2,421

    Re: SQL Query in order except first record

    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...
  19. Re: can somebody tell me how to accomplish this?

    Anything?


    MsgBox CalendarControl.DayView.GetCellNumber(Now)
  20. Re: can somebody tell me how to accomplish this?

    The function is expecting a date object. By using format, you are turning Now which is already a valid date object into a string.
  21. Replies
    10
    Views
    1,099

    Re: Problem storing Array into string

    Any reason for wanting to use an array? Wouldn't a simple replace work.

    findInvChars = (Date & " " & Time)
    findInvChars = Replace(findInvChars, ":", "/")
    findInvChars =...
  22. Replies
    15
    Views
    2,890

    Re: Deleting files in sub folders

    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...
  23. Re: HELP - Eliminating the Do..Until loop very slow completion

    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...
  24. Re: how to calculate Textboxes and sum in another textbox

    Give something like this a try.


    Private Sub txtDollar_Change()
    SumAll
    End Sub

    Private Sub txtFiftyCents_Change()
    SumAll
    End Sub
  25. Re: How to check if focus is on one of the textboxes?

    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
  26. Re: How to check if focus is on one of the textboxes?

    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...
  27. Replies
    10
    Views
    1,106

    Re: Combo cascade

    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...
  28. Replies
    10
    Views
    1,106

    Re: Combo cascade

    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...
  29. Replies
    7
    Views
    1,033

    Re: Resize textboxes at runtime

    Can you attach a sample project that's working with what you have so far?
  30. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    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...
  31. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    """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...
  32. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    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...
  33. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    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...
  34. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    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, _
    ...
  35. Replies
    39
    Views
    8,402

    Re: Emulate Double Click

    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...
  36. Re: Check array element values in immediate window

    You could also try the Locals Window to see the values of your array.
    140315
  37. Replies
    19
    Views
    5,585

    Re: VB6 Invalid Procedure Call or Argument

    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...
  38. Replies
    19
    Views
    5,585

    Re: VB6 Invalid Procedure Call or Argument

    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...
  39. Replies
    19
    Views
    5,585

    Re: VB6 Invalid Procedure Call or Argument

    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....
  40. Re: [RESOLVED] trying to display Only the Year in another for can't figure out the ty

    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.
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width