i'm trying to open a form using information from 2 already populated fields using the following code. I'm not sure how to format the WhereCondition to accomidate two fields. Any help would be great.
Private Sub Details_Click()
Dim stFrmName As String
Dim stCond1 As String
Dim stCond2 As String
stFrmName = "frmMainView"
stCond1 = "[TRANSID]=" & Me!TRANSID
stCond2 = "[REGION]=" & Me!REGION
DoCmd.OpenForm FormName:=stFrmName, WhereCondition:=stCond1 and stCond2
Forms!frmMainView.SetFocus
End Sub
Private Sub Details_Click()
Dim stFrmName As String
Dim stCond1 As String
Dim stCond2 As String
stFrmName = "frmMainView"
stCond1 = "[TRANSID]=" & Me!TRANSID
stCond2 = "[REGION]=" & Me!REGION
DoCmd.OpenForm FormName:=stFrmName, WhereCondition:=stCond1 and stCond2
Forms!frmMainView.SetFocus
End Sub