Have you looked at the functionality of dlookup?
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Tuesday, January 12, 2016 2:33 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Can't figure out my RS is blank
I want to throw a popup and set a property when a condition is met during data entry. BUT, the Q_Truck_Types from the SQL statement is blank?
What I am expecting is, if my RS (recordset) equals Me.TRUCK_TYPE then popup and set the REASON_CODE.... Or is this not how to use a recordset??? Or maybe something else is way off!
Thanks, Rohn
Private Sub UNIT_COMBO_ID_AfterUpdate()
Dim RS As DAO.Recordset
Set RS = CurrentDb.OpenRecordset("SELECT MyTruckTypes FROM TRUCK_TYPE")
If Me.UNIT_COMBO_ID > 0 Then
Me.TRUCK_TYPE = [UNIT_COMBO_ID].[Column](5)
End If
If IsNull(Me![UNIT_COMBO_ID]) Then
&nbs! p; MsgBox "Not a valid Unit ID!", vbOKOnly, "Invalid UNIT Criteria!"
Me.UNIT_COMBO_ID.SetFocus
End If
If RS.EOF = Me.TRUCK_TYPE Then
MsgBox ("FIXED MASTER, Reason Code set to 'Work Order Variance'")
Me.REASON_CODE = "Work Order Variance"
End If
Set RS = Nothing
End Sub
This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Posted by: Liz Ravenwood <Liz_Ravenwood@beaerospace.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar