这就是我想要做的。单击 btnDraw 后,我希望 Access 运行查询 Test 并将结果带回字符串获胜者。然后在 lblWinner 中显示结果。
Private Sub btnDraw_Click()
Dim winner As String
winner = ???????
lblWinner.Caption = winner
End Sub
这是 TEST 查询的 SQL 代码:
SELECT TOP 1 [Goth Table].representative
FROM [Goth Table]
WHERE ((([Goth Table].[Would you like to be entered in the drawing])=Yes))
ORDER BY Rnd(Int(Now()*id)-Now()*id);
谢谢!