Private Sub txtVerdieping_KeyPress(KeyAscii As Integer) ReDim Preserve aApp(3, 1) If KeyAscii < 48 Or KeyAscii > (48 + UBound(aApp, 1)) Then txtVerdieping.Text = "" KeyAscii = 0 MsgBox "deze vedieping bestaat niet" txtVerdieping.SetFocus Exit Sub End If End Sub ---- Private Sub txtApp_KeyPress(KeyAscii As Integer) 'als er op andere toetsen dan 'backspace(8)', 0, 1, 2 of 3 'wordt gedrukt, wordt er geen ascii-waarde doorgegeven, bijgevolg 'is er geen input in betreffende textbox If KeyAscii <> 8 And KeyAscii < 48 Or KeyAscii > 50 Then KeyAscii = 0 Exit Sub End If End Sub