K
kelvin H via AccessMonster.com
The following is a function in my Form "Enter"
--------------------------------------------------------------------------
Private Sub PoNum()
Dim strForm As String
Dim strwhere As String
strForm = "GoodOne"
strwhere = "[Forms]![GoodOne]![Orders3].[Form]![PO_Num] ='" & txtPO & "'"
If [txtPO] <> "" Then
If DCount("[Po_Num]", "Orders", "[PO_Num] ='" & txtPO & "'") = 0 Then
MsgBox "Sorry, No record matched"
txtPO.SetFocus
Else
MsgBox "yes"
DoCmd.Close acForm, "frmPopUp"
DoCmd.OpenForm FormName:=strForm, wherecondition:=strwhere
End If
End If
End Sub
------------------------------------------------------------------------
"Orders3" is the subform of Form "GoodOne" .
When the user enter the PO Number in txtPo, and press "ok" , it will go to
that record.
BUT it just show a new blank reocrd instead.
What's wrong with the programme ??? (is it the matter of subform ?)
Thanks
--------------------------------------------------------------------------
Private Sub PoNum()
Dim strForm As String
Dim strwhere As String
strForm = "GoodOne"
strwhere = "[Forms]![GoodOne]![Orders3].[Form]![PO_Num] ='" & txtPO & "'"
If [txtPO] <> "" Then
If DCount("[Po_Num]", "Orders", "[PO_Num] ='" & txtPO & "'") = 0 Then
MsgBox "Sorry, No record matched"
txtPO.SetFocus
Else
MsgBox "yes"
DoCmd.Close acForm, "frmPopUp"
DoCmd.OpenForm FormName:=strForm, wherecondition:=strwhere
End If
End If
End Sub
------------------------------------------------------------------------
"Orders3" is the subform of Form "GoodOne" .
When the user enter the PO Number in txtPo, and press "ok" , it will go to
that record.
BUT it just show a new blank reocrd instead.
What's wrong with the programme ??? (is it the matter of subform ?)
Thanks