好吧,這是我的代碼。我認爲我很接近,但是當frmCondition/Concerns Update窗體打開時,請求strCBOProperty值。我知道這可能是一個語法錯誤,但我不知道它是什麼。Docmd.acbrowsetoform其中子句
Private Sub btnLogin_Click()
Dim strCBOPassword As String
Dim strPassword As String
Dim strCBOProperty As String
Selectnull
strCBOProperty = Me.cboProperty.Column(0)
strCBOPassword = Me.cboProperty.Column(1)
strPassword = Me.txtPassword
If strCBOPassword = strPassword Then
MsgBox "Login Successful!"
DoCmd.BrowseTo acBrowseToForm, "frmCondition/Concerns Update", , "[Forms]![frmCondition/Concerns Update]!cbopropertyname = strCBOProperty"
Else
MsgBox "Invalid Password"
End If
末次
私人小組Selectnull() 如果ISNULL(Me.cboProperty)然後 MsgBox 「請選擇一個屬性」,vbOKOnly elseif的ISNULL(Me.txtPassword)然後 MsgBox「請輸入密碼」,vbOKOnly 結束如果 結束小組
查看我的回答。使用'DoCmd.OpenForm'打開一個from,然後構建WhereCondition。 – Andre