Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whats wroing in my code????

Status
Not open for further replies.

SAM453

Programmer
Jun 6, 2011
18
US
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
 
how about
Code:
DoCmd.ApplyFilter , "Run_id="&  strCriteria5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top