Search results

  1. K

    Multiple Controls on one sub

    Thank you for the reply. I ended up having to use the Load sub for the form. Also when referencing the controls I had to use Me.Controls("chk" & Cstr(i)).Afterupdate Other than that it works exactly as I wanted.
  2. K

    Multiple Controls on one sub

    I have 10 check boxes. I want all of them to run a function after update. Is there a way to put all 10 on one sub, instead of having to have a sub for each box? Instead of Sub Chk1_AfterUpdate() Function End Sub Sub Chk2_AfterUpdate() Function End Sub etc... Could I have something like...
  3. K

    Reset created item counter on form

    So lets say I create 80 text boxes. They'd be auto named Text1 through Text 80. Then I delete the last 40 of them. So now I have Text1 through Text 40. If I create a new one, it becomes Text81. Is there a way to make it start with the next available (Text41) instead? Also if I create a...
  4. K

    Using Variables in controls

    How can I make this work correctly? I have 10 text boxes and I want to use the loop to make them not visible. For i = 1 to 10 Me.Texti.Visible = False Next Tried different punctuation and even putting parts of it into a variable but still failed.
  5. K

    Split word into letters

    I am creating a database to store computer information. Using the computer name from active directory I pull IP, MAC, Make/Model, and Serial Number over the network. The basic database works, but I’m trying to make it more :cool:. This varied length string comes from us having different...
  6. K

    Split word into letters

    I thought this would work: Dim myVar as Variant oVar = VariedLengthString loVar = Len(oVar) For i = 1 to loVar toVar = Left(oVar, i) myVar(i) = toVar Next i But i get Run-time Error '13': Type Mismatch
  7. K

    Split word into letters

    Can I use split like this? myVar = Split(whatever)(0) myVar1 = Split(whatever)(1) myVar2 = Split(whatever)(2) myVar3 = Split(whatever)(3) resulting in myVar = w, myVar1 = h, myVar2 = a, myVar3 =t, etc...
  8. K

    For Next loop logic

    Heres another one. I want to do something like this For i = 1 to 5 myVari = whatever Next i So that i end up with 5 variables, myVar1 through myVar5, all as whatever.
  9. K

    For Next loop logic

    Thanks for the replies! Form_MyForm.Refresh was close, it was .Repaint that did the trick. Form_MyForm.MyField.Refresh/Repaint errors. Thank you very much.
  10. K

    For Next loop logic

    Thanks for the reply! This code seems to work properly, however the Form_MyForm.MyField is still not outputting to the field until after all the loops have run. I changed it to msgbox, and a msgbox popped up with the random numbers each time, however once i changed it back, it went back to...
  11. K

    For Next loop logic

    My code: Dim rfoct As Integer For i = 1 To 5 rfoct = Int((999 - 100 + 1) * Rnd + 100) Form_MyForm.MyField = rfoct Next i I want to see each number, then have it overwritten by the next number. Slow enough to see the number. Right now the loop either goes so fast or I only get the last loop...
Back
Top Bottom