Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
strSql = "SELECT TOP 1 TipDay FROM TipofDay " & vbCrLf
' strSql = strSql & "WHERE (((Randomizer()) = 0)) " & vbCrLf
strSql = strSql & "ORDER BY Rnd(IsNull([TipofDay].[Id])*0+1)"
If EditPass.State = 1 Then EditPass.Close()
With EditPass
.Open(strSql, CN, 1, 2)
If .RecordCount = 1 Then Me.Label1.Text = .Fields(0).Value & " - " & .Fields(1).Value
End With
SELECT TOP 1 Blad1.Id, Blad1.nr, Blad1.Instelling, Blad1.Toepassing, Blad1.Bedrag, StrConv([Instelling],3) & " - " & StrConv([Toepassing],3) & " - " & Format([Bedrag],"Currency") AS Tekstreeks
FROM Blad1
WHERE (((Randomizer())=0))
ORDER BY Rnd(IsNull(Blad1.Id)*0+1);
Private Sub Form_Current()
strSql = "SELECT ID, TipDay FROM TipofDay "
x = rndRecord(AdoRecordCount(strSql))
With rsADO
.Open strSql, CurrentProject.Connection, adOpenKeyset
.MoveFirst
For i = 1 To x
.MoveNext
Next
Me.Label1 = .Fields(0).Value & " - " & .Fields(1).Value
.Close
End With
End Sub
Function AdoRecordCount(SQL As String) As Integer
Dim rs As New ADODB.Recordset
With rs
.Open SQL, CurrentProject.Connection, adOpenKeyset
AdoRecordCount = .RecordCount
End With
rs.Close
Set rs = Nothing
End Function
Function rndRecord(numRec As Long) As Long
rndRecord = Int((numRec * Rnd) + 1)
End Function
Private Sub cmdRandom_Click()
strSql = "SELECT ID, TipDay FROM TipofDay "
x = rndRecord(AdoRecordCount(strSql))
With rsADO
.Open strSql, CurrentProject.Connection, adOpenKeyset
.MoveFirst
For i = 1 To x
.MoveNext
Next
Me.Label1 = .Fields(0).Value & " - " & .Fields(1).Value
.Close
End With
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.