• Privacywetgeving
    Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.

userform, ik kom er niet meer uit.

Status
Niet open voor verdere reacties.

Revdutchie

Gebruiker
Lid geworden
29 nov 2009
Berichten
645
Hallo weer,

Daar heb je hem weer met zijn dart programma :D

Als mijn programma opent kun je naar competitie, daar kan je de instellingen per wedstrijd invoeren. staat default goed. Dan ga je naar start competitie en dan start game 1, dan wordt in het nieuwe form automatisch de gele imputbox geselecteerd, na winst kom je weer terug in het overzicht. Tot zover gaat alles goed, maar als je dan game 2 start, selecteerd hij niet de goede imputbox en de kleur klopt niet.

Ik weet het de uitleg is een beetje cryptisch, maar daarvoor moet je ook de bijlage openen.

PS, voor dartliefhebbers, feel free to download it. Ik vind het erg mooi.
 

Bijlagen

Laatst bewerkt:
Voor degene die het leuk vinden, er hoort nog een soundfile bij, maar die is 34Mb, stuur me maar een PB dan mail ik die wel.
 
Leg het uit zonder de bijlage te moeten openen; hoe helderder de vraagstelling hoe eenvoudiger de oplossing.
 
Leg het uit zonder de bijlage te moeten openen; hoe helderder de vraagstelling hoe eenvoudiger de oplossing.

Beetje rare vraag, daar er altijd wordt gevraagd om een voorbeeld bestand te posten en nu wil jij de vraag juist zonder voorbeeld bestand :p

Ok, ga een poging wagen.

ik heb een userform waar de wedstrijden van die avond staan. Als ik op begin wedstrijd 1 klik, dan opent het de sheet waar de scores op staan EN een userform waar je de scores invult in 2 textboxen. Bij start is textbox2 setfocus en ook selected en als achtergrond geel.

Er worden in die (eerste) wedstrijd een aantal sets of legs gespeelt, zodra de target door 1 van 2 spelers is gehaald, sluit de userform scoreinvoer zich en opent het een userform met het overzicht.

Als ik dan wedstrijd 2 selecteer opent het wederom de (zelfde) sheet met scores EN hetzelfde userform waar je de scores invult, echter dan is setfocus fout en geselecteerde textbox fout.

ok, snb, dat was de uitleg zonder openen bestand, maar zou me verbazen of iemand hiermee iets kan zonder het bestand te openen.

@snb, ik heb geprobeerd in alles select en activate te vermijden volgens jou regels, maar hoe doe ik dat op mijn userform compoverzicht als ik dmv een knop een sheet moet selecteren. Heb dat dus wel wet select gedaan ?
 
Laatst bewerkt:
Niet zo'n rare vraag; met jouw bestand gaat Excel bij mij plat.

Ik heb nooit de noodzaak van setfocus ingezien.(kjik eens naar de tabvolgorde, het gebruik van een frame of desnoods enabeld =false voor de elementen die je niet geaktiveerd wil zien.)
De behoefte aan 2 userforms lijkt mij ook beperkt (kijk eens bij multipage)
Tenslotte hoef je een werkblad niet te 'selecteren' om er gegevens uit te lezen of in weg te schrijven. (plaats desnoods die code die je daarvoor gebruikt hier).
 
Niet zo'n rare vraag; met jouw bestand gaat Excel bij mij plat.

Bij deze opmerking sluit ik me volledig aan , bij het openen loopt het al fout en na het afsluiten van het bestandje moet ik excel uit - en terug aan zetten want anders is het lint in excel 2007 en 2010 weg .
 
Er zijn nog meer zorgen:

gebruik
Code:
if [Variadata!E8] = 1 or [Variadata!F8] = 1 and ([VariaData!B1] > 0 and [VariaData!B1] < 13) then
  Scoreinvoer.Hide
  Compoverzicht.Show
End if
in plaats van

Code:
If [VariaData!B1] = 1 And [Variadata!E8] = 1 Or [VariaData!B1] = 1 And [Variadata!F8] = 1 Then
  Scoreinvoer.Hide
  Compoverzicht.Show
End If

If [VariaData!B1] = 2 And [Variadata!H8] = 1 Or [VariaData!B1] = 2 And [Variadata!I8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 3 And [Variadata!K8] = 1 Or [VariaData!B1] = 3 And [Variadata!L8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 4 And [Variadata!N8] = 1 Or [VariaData!B1] = 4 And [Variadata!O8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 5 And [Variadata!Q8] = 1 Or [VariaData!B1] = 5 And [Variadata!R8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 6 And [Variadata!T8] = 1 Or [VariaData!B1] = 6 And [Variadata!U8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 7 And [Variadata!W8] = 1 Or [VariaData!B1] = 7 And [Variadata!X8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 8 And [Variadata!Z8] = 1 Or [VariaData!B1] = 8 And [Variadata!AA8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 9 And [Variadata!AC8] = 1 Or [VariaData!B1] = 9 And [Variadata!AD8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 10 And [Variadata!AF8] = 1 Or [VariaData!B1] = 10 And [Variadata!AG8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 11 And [Variadata!AI8] = 1 Or [VariaData!B1] = 11 And [Variadata!AJ8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If

If [VariaData!B1] = 12 And [Variadata!al8] = 1 Or [VariaData!B1] = 12 And [Variadata!am8] = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If
 
Nee dat kan niet,

Als varia B1 = 1 then Varia E8 en F8
Als varia B1 = 2 then Varia H8 en I8
etc etc
 
Laatst bewerkt:
Dan zou je het gedeelte dat snb aangeeft wel kunnen vervangen door

Code:
Y = 0
For X = 0 To 12
If [VariaData!B1] = X + 1 And Sheets("Variadata").Cells(8, 5 + 2 * X + Y) = 1 Or [VariaData!B1] = X + 1 And Sheets("Variadata").Cells(8, 6 + 2 * X + Y) = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If
Y = Y + 1
Next X
 
Dan zou je het gedeelte dat snb aangeeft wel kunnen vervangen door

Code:
Y = 0
For X = 0 To 12
If [VariaData!B1] = X + 1 And Sheets("Variadata").Cells(8, 5 + 2 * X + Y) = 1 Or [VariaData!B1] = X + 1 And Sheets("Variadata").Cells(8, 6 + 2 * X + Y) = 1 Then
Sheets("Waarschuwing").Select
Scoreinvoer.Hide
Compoverzicht.Show
End If
Y = Y + 1
Next X

Dat werkt idd super, thanks. het kan volgens mij nog korter, maar ik ben er niet zo goed in, het is namelijk altijd [B1] * 3 naar rechts in rij 8
 
In de bijlage een voorbeeld hoe 5 userforms door 1 kunnen worden vervangen met Multipage.
Je hoeft 'alleen' de code nog maar aan te passen.
In het startuserform staan nu alle 5 userforms.
 

Bijlagen

In de bijlage een voorbeeld hoe 5 userforms door 1 kunnen worden vervangen met Multipage.
Je hoeft 'alleen' de code nog maar aan te passen.
In het startuserform staan nu alle 5 userforms.

Als dat beter werkt is dat een oplossing, ik vind alleen die grijze bladtabs oerlelijk, zijn die er niet uit te slopen en custom buttons voor te maken, of ze op ze minst een andere achtergrond en textkleur ?
 
Ja hoor, die heb ik alleen even voor jouw gemak zichtbaar gelaten. Met 1 wijziging van de eigenschappen van de multipage zijn ze verdwenen. (zoek zelf even uit hoe). Geen gebruiker zal zien dat je gebruik maakt van Multipage, en 1 frame per page. Op deze manier is het ook veel minder werk om de achtergrondkleur per tabblad (en daarmee van alle elementen op het tabblad, omdat ze tranparant zijn) te wijzigen.
 
Ja hoor, die heb ik alleen even voor jouw gemak zichtbaar gelaten. Met 1 wijziging van de eigenschappen van de multipage zijn ze verdwenen. (zoek zelf even uit hoe). Geen gebruiker zal zien dat je gebruik maakt van Multipage, en 1 frame per page. Op deze manier is het ook veel minder werk om de achtergrondkleur per tabblad (en daarmee van alle elementen op het tabblad, omdat ze tranparant zijn) te wijzigen.

Ok, als ik dat had geweten, had ik het idd op die manier opgezet, maar ik heb de hele avond nog voor me :D:D
 
Niet getest maar dit

Code:
f [VariaData!F2] <> "" Then
ScoreThuisGame1.Visible = False
StreepjeGame1.Visible = False
ScoreUitGame1.Visible = False
GameUitslag1.Visible = False
GameSetsLegs1.Visible = True
StartGame1.Visible = True
GameType1.Visible = True
GameAantalSets1.Visible = True
GameAantalLegs1.Visible = True
GameType1 = [VariaData!F2]
GameAantalSets1 = [variadata!F4]
GameAantalLegs1 = [VariaData!F5]
End If

If [Variadata!E8] = 1 Or [Variadata!F8] = 1 Then
ScoreThuisGame1.Visible = True
If [variadata!F4] = 1 Then ScoreThuisGame1 = [Variadata!E12] Else ScoreThuisGame1 = [Variadata!E10]
StreepjeGame1.Visible = True
ScoreUitGame1.Visible = True
If [variadata!F4] = 1 Then ScoreUitGame1 = [Variadata!F12] Else ScoreUitGame1 = [Variadata!F10]
GameUitslag1.Visible = True
GameSetsLegs1.Visible = False
StartGame1.Visible = False
GameType1.Visible = False
GameAantalSets1.Visible = False
GameAantalLegs1.Visible = False
End If

If [VariaData!F2] = "" Then
ScoreThuisGame1.Visible = False
StreepjeGame1.Visible = False
ScoreUitGame1.Visible = False
GameUitslag1.Visible = False
GameSetsLegs1.Visible = False
StartGame1.Visible = False
GameType1.Visible = False
GameAantalSets1.Visible = False
GameAantalLegs1.Visible = False
End If


If [VariaData!I2] <> "" Then
ScoreThuisGame2.Visible = False
StreepjeGame2.Visible = False
ScoreUitGame2.Visible = False
GameUitslag2.Visible = False
GameSetsLegs2.Visible = True
StartGame2.Visible = True
GameType2.Visible = True
GameAantalSets2.Visible = True
GameAantalLegs2.Visible = True
GameType2 = [VariaData!I2]
GameAantalSets2 = [variadata!I4]
GameAantalLegs2 = [VariaData!I5]
End If

If [Variadata!H8] = 1 Or [Variadata!I8] = 1 Then
ScoreThuisGame2.Visible = True
If [variadata!I4] = 1 Then ScoreThuisGame2 = [Variadata!H12] Else ScoreThuisGame2 = [Variadata!H10]
StreepjeGame2.Visible = True
ScoreUitGame2.Visible = True
If [variadata!I4] = 1 Then ScoreUitGame2 = [Variadata!I12] Else ScoreUitGame2 = [Variadata!I10]
GameUitslag2.Visible = True
GameSetsLegs2.Visible = False
StartGame2.Visible = False
GameType2.Visible = False
GameAantalSets2.Visible = False
GameAantalLegs2.Visible = False
End If

If [VariaData!I2] = "" Then
ScoreThuisGame2.Visible = False
StreepjeGame2.Visible = False
ScoreUitGame2.Visible = False
GameUitslag2.Visible = False
GameSetsLegs2.Visible = False
StartGame2.Visible = False
GameType2.Visible = False
GameAantalSets2.Visible = False
GameAantalLegs2.Visible = False
End If


If [VariaData!L2] <> "" Then
ScoreThuisGame3.Visible = False
StreepjeGame3.Visible = False
ScoreUitGame3.Visible = False
GameUitslag3.Visible = False
GameSetsLegs3.Visible = True
StartGame3.Visible = True
GameType3.Visible = True
GameAantalSets3.Visible = True
GameAantalLegs3.Visible = True
GameType3 = [VariaData!L2]
GameAantalSets3 = [variadata!L4]
GameAantalLegs3 = [VariaData!L5]
End If

If [Variadata!K8] = 1 Or [Variadata!L8] = 1 Then
ScoreThuisGame3.Visible = True
If [variadata!L4] = 1 Then ScoreThuisGame3 = [Variadata!K12] Else ScoreThuisGame3 = [Variadata!K10]
StreepjeGame3.Visible = True
ScoreUitGame3.Visible = True
If [variadata!L4] = 1 Then ScoreUitGame3 = [Variadata!L12] Else ScoreUitGame3 = [Variadata!L10]
GameUitslag3.Visible = True
GameSetsLegs3.Visible = False
StartGame3.Visible = False
GameType3.Visible = False
GameAantalSets3.Visible = False
GameAantalLegs3.Visible = False
End If

If [VariaData!L2] = "" Then
ScoreThuisGame3.Visible = False
StreepjeGame3.Visible = False
ScoreUitGame3.Visible = False
GameUitslag3.Visible = False
GameSetsLegs3.Visible = False
StartGame3.Visible = False
GameType3.Visible = False
GameAantalSets3.Visible = False
GameAantalLegs3.Visible = False
End If

If [VariaData!O2] <> "" Then
ScoreThuisGame4.Visible = False
StreepjeGame4.Visible = False
ScoreUitGame4.Visible = False
GameUitslag4.Visible = False
GameSetsLegs4.Visible = True
StartGame4.Visible = True
GameType4.Visible = True
GameAantalSets4.Visible = True
GameAantalLegs4.Visible = True
GameType4 = [VariaData!O2]
GameAantalSets4 = [variadata!O4]
GameAantalLegs4 = [VariaData!O5]
End If

If [Variadata!N8] = 1 Or [Variadata!O8] = 1 Then
ScoreThuisGame4.Visible = True
If [variadata!O4] = 1 Then ScoreThuisGame4 = [Variadata!N12] Else ScoreThuisGame4 = [Variadata!N10]
StreepjeGame4.Visible = True
ScoreUitGame4.Visible = True
If [variadata!O4] = 1 Then ScoreUitGame4 = [Variadata!O12] Else ScoreUitGame4 = [Variadata!O10]
GameUitslag4.Visible = True
GameSetsLegs4.Visible = False
StartGame4.Visible = False
GameType4.Visible = False
GameAantalSets4.Visible = False
GameAantalLegs4.Visible = False
End If

If [VariaData!O2] = "" Then
ScoreThuisGame4.Visible = False
StreepjeGame4.Visible = False
ScoreUitGame4.Visible = False
GameUitslag4.Visible = False
GameSetsLegs4.Visible = False
StartGame4.Visible = False
GameType4.Visible = False
GameAantalSets4.Visible = False
GameAantalLegs4.Visible = False
End If


If [VariaData!R2] <> "" Then
ScoreThuisGame5.Visible = False
StreepjeGame5.Visible = False
ScoreUitGame5.Visible = False
GameUitslag5.Visible = False
GameSetsLegs5.Visible = True
StartGame5.Visible = True
GameType5.Visible = True
GameAantalSets5.Visible = True
GameAantalLegs5.Visible = True
GameType5 = [VariaData!R2]
GameAantalSets5 = [variadata!R4]
GameAantalLegs5 = [VariaData!R5]
End If

If [Variadata!Q8] = 1 Or [Variadata!R8] = 1 Then
ScoreThuisGame5.Visible = True
If [variadata!R4] = 1 Then ScoreThuisGame5 = [Variadata!Q12] Else ScoreThuisGame5 = [Variadata!Q10]
StreepjeGame5.Visible = True
ScoreUitGame5.Visible = True
If [variadata!R4] = 1 Then ScoreUitGame5 = [Variadata!R12] Else ScoreUitGame5 = [Variadata!R10]
GameUitslag5.Visible = True
GameSetsLegs5.Visible = False
StartGame5.Visible = False
GameType5.Visible = False
GameAantalSets5.Visible = False
GameAantalLegs5.Visible = False
End If

If [VariaData!R2] = "" Then
ScoreThuisGame5.Visible = False
StreepjeGame5.Visible = False
ScoreUitGame5.Visible = False
GameUitslag5.Visible = False
GameSetsLegs5.Visible = False
StartGame5.Visible = False
GameType5.Visible = False
GameAantalSets5.Visible = False
GameAantalLegs5.Visible = False
End If


If [VariaData!U2] <> "" Then
ScoreThuisGame6.Visible = False
StreepjeGame6.Visible = False
ScoreUitGame6.Visible = False
GameUitslag6.Visible = False
GameSetsLegs6.Visible = True
StartGame6.Visible = True
GameType6.Visible = True
GameAantalSets6.Visible = True
GameAantalLegs6.Visible = True
GameType6 = [VariaData!U2]
GameAantalSets6 = [variadata!U4]
GameAantalLegs6 = [VariaData!U5]
End If

If [Variadata!T8] = 1 Or [Variadata!U8] = 1 Then
ScoreThuisGame6.Visible = True
If [variadata!U4] = 1 Then ScoreThuisGame6 = [Variadata!T12] Else ScoreThuisGame6 = [Variadata!T10]
StreepjeGame6.Visible = True
ScoreUitGame6.Visible = True
If [variadata!U4] = 1 Then ScoreUitGame6 = [Variadata!U12] Else ScoreUitGame6 = [Variadata!U10]
GameUitslag6.Visible = True
GameSetsLegs6.Visible = False
StartGame6.Visible = False
GameType6.Visible = False
GameAantalSets6.Visible = False
GameAantalLegs6.Visible = False
End If

If [VariaData!U2] = "" Then
ScoreThuisGame6.Visible = False
StreepjeGame6.Visible = False
ScoreUitGame6.Visible = False
GameUitslag6.Visible = False
GameSetsLegs6.Visible = False
StartGame6.Visible = False
GameType6.Visible = False
GameAantalSets6.Visible = False
GameAantalLegs6.Visible = False
End If

If [VariaData!X2] <> "" Then
ScoreThuisGame7.Visible = False
StreepjeGame7.Visible = False
ScoreUitGame7.Visible = False
GameUitslag7.Visible = False
GameSetsLegs7.Visible = True
StartGame7.Visible = True
GameType7.Visible = True
GameAantalSets7.Visible = True
GameAantalLegs7.Visible = True
GameType7 = [VariaData!X2]
GameAantalSets7 = [variadata!X4]
GameAantalLegs7 = [VariaData!X5]
End If

If [Variadata!W8] = 1 Or [Variadata!X8] = 1 Then
ScoreThuisGame7.Visible = True
If [variadata!X4] = 1 Then ScoreThuisGame7 = [Variadata!W12] Else ScoreThuisGame7 = [Variadata!W10]
StreepjeGame7.Visible = True
ScoreUitGame7.Visible = True
If [variadata!X4] = 1 Then ScoreUitGame7 = [Variadata!X12] Else ScoreUitGame7 = [Variadata!X10]
GameUitslag7.Visible = True
GameSetsLegs7.Visible = False
StartGame7.Visible = False
GameType7.Visible = False
GameAantalSets7.Visible = False
GameAantalLegs7.Visible = False
End If

If [VariaData!X2] = "" Then
ScoreThuisGame7.Visible = False
StreepjeGame7.Visible = False
ScoreUitGame7.Visible = False
GameUitslag7.Visible = False
GameSetsLegs7.Visible = False
StartGame7.Visible = False
GameType7.Visible = False
GameAantalSets7.Visible = False
GameAantalLegs7.Visible = False
End If


If [VariaData!AA2] <> "" Then
ScoreThuisGame8.Visible = False
StreepjeGame8.Visible = False
ScoreUitGame8.Visible = False
GameUitslag8.Visible = False
GameSetsLegs8.Visible = True
StartGame8.Visible = True
GameType8.Visible = True
GameAantalSets8.Visible = True
GameAantalLegs8.Visible = True
GameType8 = [VariaData!AA2]
GameAantalSets8 = [variadata!AA4]
GameAantalLegs8 = [VariaData!AA5]
End If

If [Variadata!Z8] = 1 Or [Variadata!AA8] = 1 Then
ScoreThuisGame8.Visible = True
If [variadata!AA4] = 1 Then ScoreThuisGame8 = [Variadata!Z12] Else ScoreThuisGame8 = [Variadata!Z10]
StreepjeGame8.Visible = True
ScoreUitGame8.Visible = True
If [variadata!AA4] = 1 Then ScoreUitGame8 = [Variadata!AA12] Else ScoreUitGame8 = [Variadata!AA10]
GameUitslag8.Visible = True
GameSetsLegs8.Visible = False
StartGame8.Visible = False
GameType8.Visible = False
GameAantalSets8.Visible = False
GameAantalLegs8.Visible = False
End If

If [VariaData!AA2] = "" Then
ScoreThuisGame8.Visible = False
StreepjeGame8.Visible = False
ScoreUitGame8.Visible = False
GameUitslag8.Visible = False
GameSetsLegs8.Visible = False
StartGame8.Visible = False
GameType8.Visible = False
GameAantalSets8.Visible = False
GameAantalLegs8.Visible = False
End If


If [VariaData!AD2] <> "" Then
ScoreThuisGame9.Visible = False
StreepjeGame9.Visible = False
ScoreUitGame9.Visible = False
GameUitslag9.Visible = False
GameSetsLegs9.Visible = True
StartGame9.Visible = True
GameType9.Visible = True
GameAantalSets9.Visible = True
GameAantalLegs9.Visible = True
GameType9 = [VariaData!AD2]
GameAantalSets9 = [variadata!AD4]
GameAantalLegs9 = [VariaData!AD5]
End If

If [Variadata!AC8] = 1 Or [Variadata!AD8] = 1 Then
ScoreThuisGame9.Visible = True
If [variadata!AD4] = 1 Then ScoreThuisGame9 = [Variadata!AC12] Else ScoreThuisGame9 = [Variadata!AC10]
StreepjeGame9.Visible = True
ScoreUitGame9.Visible = True
If [variadata!AD4] = 1 Then ScoreUitGame9 = [Variadata!AD12] Else ScoreUitGame9 = [Variadata!AD10]
GameUitslag9.Visible = True
GameSetsLegs9.Visible = False
StartGame9.Visible = False
GameType9.Visible = False
GameAantalSets9.Visible = False
GameAantalLegs9.Visible = False
End If

If [VariaData!AD2] = "" Then
ScoreThuisGame9.Visible = False
StreepjeGame9.Visible = False
ScoreUitGame9.Visible = False
GameUitslag9.Visible = False
GameSetsLegs9.Visible = False
StartGame9.Visible = False
GameType9.Visible = False
GameAantalSets9.Visible = False
GameAantalLegs9.Visible = False
End If


If [VariaData!AG2] <> "" Then
ScoreThuisGame10.Visible = False
StreepjeGame10.Visible = False
ScoreUitGame10.Visible = False
GameUitslag10.Visible = False
GameSetsLegs10.Visible = True
StartGame10.Visible = True
GameType10.Visible = True
GameAantalSets10.Visible = True
GameAantalLegs10.Visible = True
GameType10 = [VariaData!AG2]
GameAantalSets10 = [variadata!AG4]
GameAantalLegs10 = [VariaData!AG5]
End If

If [Variadata!AF8] = 1 Or [Variadata!AG8] = 1 Then
ScoreThuisGame10.Visible = True
If [variadata!AG4] = 1 Then ScoreThuisGame10 = [Variadata!AF12] Else ScoreThuisGame10 = [Variadata!AF10]
StreepjeGame10.Visible = True
ScoreUitGame10.Visible = True
If [variadata!AG4] = 1 Then ScoreUitGame10 = [Variadata!AG12] Else ScoreUitGame10 = [Variadata!AG10]
GameUitslag10.Visible = True
GameSetsLegs10.Visible = False
StartGame10.Visible = False
GameType10.Visible = False
GameAantalSets10.Visible = False
GameAantalLegs10.Visible = False
End If

If [VariaData!AG2] = "" Then
ScoreThuisGame10.Visible = False
StreepjeGame10.Visible = False
ScoreUitGame10.Visible = False
GameUitslag10.Visible = False
GameSetsLegs10.Visible = False
StartGame10.Visible = False
GameType10.Visible = False
GameAantalSets10.Visible = False
GameAantalLegs10.Visible = False
End If


If [VariaData!aj2] <> "" Then
ScoreThuisGame11.Visible = False
StreepjeGame11.Visible = False
ScoreUitGame11.Visible = False
GameUitslag11.Visible = False
GameSetsLegs11.Visible = True
StartGame11.Visible = True
GameType11.Visible = True
GameAantalSets11.Visible = True
GameAantalLegs11.Visible = True
GameType11 = [VariaData!aj2]
GameAantalSets11 = [variadata!AJ4]
GameAantalLegs11 = [VariaData!AJ5]
End If

If [Variadata!AI8] = 1 Or [Variadata!AJ8] = 1 Then
ScoreThuisGame11.Visible = True
If [variadata!AJ4] = 1 Then ScoreThuisGame11 = [Variadata!AI12] Else ScoreThuisGame11 = [Variadata!AI10]
StreepjeGame11.Visible = True
ScoreUitGame11.Visible = True
If [variadata!AJ4] = 1 Then ScoreUitGame11 = [Variadata!AJ12] Else ScoreUitGame11 = [Variadata!AJ10]
GameUitslag11.Visible = True
GameSetsLegs11.Visible = False
StartGame11.Visible = False
GameType11.Visible = False
GameAantalSets11.Visible = False
GameAantalLegs11.Visible = False
End If

If [VariaData!aj2] = "" Then
ScoreThuisGame11.Visible = False
StreepjeGame11.Visible = False
ScoreUitGame11.Visible = False
GameUitslag11.Visible = False
GameSetsLegs11.Visible = False
StartGame11.Visible = False
GameType11.Visible = False
GameAantalSets11.Visible = False
GameAantalLegs11.Visible = False
End If

If [VariaData!AM2] <> "" Then
ScoreThuisGame12.Visible = False
StreepjeGame12.Visible = False
ScoreUitGame12.Visible = False
GameUitslag12.Visible = False
GameSetsLegs12.Visible = True
StartGame12.Visible = True
GameType12.Visible = True
GameAantalSets12.Visible = True
GameAantalLegs12.Visible = True
GameType12 = [VariaData!AM2]
GameAantalSets12 = [variadata!am4]
GameAantalLegs12 = [VariaData!AM5]
End If

If [Variadata!al8] = 1 Or [Variadata!am8] = 1 Then
ScoreThuisGame12.Visible = True
If [variadata!am4] = 1 Then ScoreThuisGame12 = [Variadata!al12] Else ScoreThuisGame12 = [Variadata!al10]
StreepjeGame12.Visible = True
ScoreUitGame12.Visible = True
If [variadata!am4] = 1 Then ScoreUitGame12 = [Variadata!am12] Else ScoreUitGame12 = [Variadata!am10]
GameUitslag12.Visible = True
GameSetsLegs12.Visible = False
StartGame12.Visible = False
GameType12.Visible = False
GameAantalSets12.Visible = False
GameAantalLegs12.Visible = False
End If

If [VariaData!AM2] = "" Then
ScoreThuisGame12.Visible = False
StreepjeGame12.Visible = False
ScoreUitGame12.Visible = False
GameUitslag12.Visible = False
GameSetsLegs12.Visible = False
StartGame12.Visible = False
GameType12.Visible = False
GameAantalSets12.Visible = False
GameAantalLegs12.Visible = False
End If

is vervangbaar door zoiets

Code:
For n = 1 To 12
If Sheets("VariaData").Cells(2, 3 + n * 3) <> "" Then
Me.controles(ScoreThuisGame & n).Visible = False
Me.controles(StreepjeGame & n).Visible = False
Me.controles(ScoreUitGame & n).Visible = False
Me.controles(GameUitslag & n).Visible = False
Me.controles(GameSetsLegs & n).Visible = True
Me.controles(StartGame & n).Visible = True
Me.controles(Gametype & n).Visible = True
Me.controles(GameAantalSets & n).Visible = True
Me.controles(GameAantalLegs & n).Visible = True
Me.controles(Gametype & n) = Sheets("VariaData").Cells(2, 3 + n * 3)
Me.controles(GameAantalSets & n) = Sheets("VariaData").Cells(4, 3 + n * 3)
Me.controles(GameAantalLegs & n) = Sheets("VariaData").Cells(5, 3 + n * 3)
End If

If Sheets("VariaData").Cells(8, 2 + n * 3) = 1 Or Sheets("VariaData").Cells(8, 3 + n * 3) = 1 Then
Me.controles(ScoreThuisGame & n).Visible = True
If Sheets("VariaData").Cells(4, 3 + n * 3) = 1 Then Me.controles(ScoreThuisGame & n).Visible = Sheets("VariaData").Cells(12, 2 + n * 3) Else Me.controles(ScoreThuisGame & n).Visible = Sheets("VariaData").Cells(12, 2 + n * 3)
Me.controles(StreepjeGame & n).Visible = True
Me.controles(ScoreUitGame & n).Visible = True
If Sheets("VariaData").Cells(4, 3 + n * 3) = 1 Then Me.controles(ScoreUitGame & n) = Sheets("VariaData").Cells(12, 3 + n * 3) Else ScoreUitGame1 = Sheets("VariaData").Cells(10, 3 + n * 3)
Me.controles(GameUitslag & n).Visible = True
Me.controles(GameAantalLegs & n).Visible = False
Me.controles(StartGame & n).Visible = False
Me.controles(Gametype & n).Visible = False
Me.controles(GameAantalSets & n) = False
Me.controles(GameAantalLegs & n) = False
End If

If Sheets("VariaData").Cells(2, 3 + n * 3) = "" Then
Me.controles(ScoreThuisGame & n) = False
Me.controles(StreepjeGame & n).Visible = False
Me.controles(ScoreUitGame & n) = False
Me.controles(GameUitslag & n) = False
Me.controles(GameSetsLegs & n) = False
Me.controles(StartGame & n).Visible = False
Me.controles(Gametype & n).Visible = False
Me.controles(GameAantalSets & n).Visible = False
Me.controles(GameAantalLegs & n).Visible = False
End If
Next n


Groeten Niels


edit mecontrols aangepast naar me.controls
edir 2 was er een paar vergeten
 
Laatst bewerkt:
Multipage1.style=2-fmTabstyleNone

@Niels
Code:
  For n = 1 To 12
      If Sheets("VariaData").Cells(2, 3 + n * 3) <> "" Then
         Me("ScoreThuisGame" & n).Visible = False
         Me("StreepjeGame" & n).Visible = False
         Me("ScoreUitGame" & n).Visible = False
         Me("GameUitslag" & n).Visible = False
         Me("GameSetsLegs" & n).Visible = True
         Me("StartGame" & n).Visible = True
         Me("Gametype" & n).Visible = True
         Me("GameAantalSets" & n).Visible = True
         Me("GameAantalLegs" & n).Visible = True
         Me("Gametype" & n) = Sheets("VariaData").Cells(2, 3 + n * 3)
         Me("GameAantalSets" & n) = Sheets("VariaData").Cells(4, 3 + n * 3)
         Me("GameAantalLegs" & n) = Sheets("VariaData").Cells(5, 3 + n * 3)
      End If
  Next
of
Code:
  For n = 1 To 12
      If Sheets("VariaData").Cells(2, 3 + n * 3) <> "" Then
         Controls("ScoreThuisGame" & n).Visible = False
         Controls("StreepjeGame" & n).Visible = False
         Controls("ScoreUitGame" & n).Visible = False
         Controls("GameUitslag" & n).Visible = False
         Controls("GameSetsLegs" & n).Visible = True
         Controls("StartGame" & n).Visible = True
         Controls("Gametype" & n).Visible = True
         Controls("GameAantalSets" & n).Visible = True
         Controls("GameAantalLegs" & n).Visible = True
         Controls("Gametype" & n) = Sheets("VariaData").Cells(2, 3 + n * 3)
         Controls("GameAantalSets" & n) = Sheets("VariaData").Cells(4, 3 + n * 3)
         Controls("GameAantalLegs" & n) = Sheets("VariaData").Cells(5, 3 + n * 3)
      End If
  Next
 
Laatst bewerkt:
@Niels,

Nee, dat werkt niet krijg een foutmelding op de eerste lijn me.controles
"Kan methode of gegevenslid niet vinden"

Dacht even een typ foutje en controles verandert in controls, maar dat was het ook niet.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan