Hi. Any help would be greatly appreciated. I'm trying to query my database for the most recent record for a tank specified by the user on a form. I have an If then statement based on that query as shown below:
If DCount("LotNum", "[Blendsheet Input]", "TankNum ='" & Me.cmbTankNum & "'") = 0 Then
Me.TxtStatus = "Not Finalled"
Else
Me.TxtStatus = "Finalled"
End If
Exit_Close_Click:
Exit Sub
End Sub
This partially works. When I add a new record that should return a "Not Finalled," The query returns a "Finalled." The code doesn't seem to be reading most recent entry. Can someone let me know what i'm doing wrong?
Thanks
If DCount("LotNum", "[Blendsheet Input]", "TankNum ='" & Me.cmbTankNum & "'") = 0 Then
Me.TxtStatus = "Not Finalled"
Else
Me.TxtStatus = "Finalled"
End If
Exit_Close_Click:
Exit Sub
End Sub
This partially works. When I add a new record that should return a "Not Finalled," The query returns a "Finalled." The code doesn't seem to be reading most recent entry. Can someone let me know what i'm doing wrong?
Thanks