Hi i'm using below code. What i want is i'm passing a text feild in combo17 and it should open a table only with the records where id is maximun and the reject type which i passed in combo 17. I used the below code it's not getting me the max id records it represents all records
Private Sub Command1_Click()
Dim strCriteria2 As String
Dim strCriteria4 As String
Dim strCriteria5 As String
'strCriteria2 = "Reject_Type='" & Me.Combo17.Value & "'"
strCriteria5 = DMax("Run_id", "Staging_BC_GL_Reject", "Reject_Type='" & Me.Combo17.Value & "'")
‘strCriteria4 = strCriteria2 & " and " & strCriteria5
If IsNull(Combo17.Value) = True Then
DoCmd.OpenTable "Staging_BC_GL_Reject"
End If
If IsNull(Combo17.Value) = False Then
DoCmd.OpenTable "Staging_BC_GL_Reject"
DoCmd.ApplyFilter , strCriteria5
End If
End Sub
Private Sub Command1_Click()
Dim strCriteria2 As String
Dim strCriteria4 As String
Dim strCriteria5 As String
'strCriteria2 = "Reject_Type='" & Me.Combo17.Value & "'"
strCriteria5 = DMax("Run_id", "Staging_BC_GL_Reject", "Reject_Type='" & Me.Combo17.Value & "'")
‘strCriteria4 = strCriteria2 & " and " & strCriteria5
If IsNull(Combo17.Value) = True Then
DoCmd.OpenTable "Staging_BC_GL_Reject"
End If
If IsNull(Combo17.Value) = False Then
DoCmd.OpenTable "Staging_BC_GL_Reject"
DoCmd.ApplyFilter , strCriteria5
End If
End Sub