Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim strSQL As String
Dim strCode As String
strSQL = "SELECT PID, Code, Serial FROM Import_PT1_Table Order By PID"
With rst
.Open strSQL, MyDB
Do While Not .EOF
If Not IsNull(!Code.Value) Then
strCode = !Code.Value
Else
strSQL = "Update Import_PT1_Table Set Code = '" & strCode & "' Where PID = " & !PID.Value
MyDB.Execute strSQL
End If
.MoveNext
Loop
.Close
End With
Set rst = Nothing
tblCode
ID Code
1 ABD
2 ABJ
3 ABU
4 ACC
5 XYZ
Dim rst As Recordset
...
Set rst = CurrentDb.OpenRecordset(strSQL)
...
select
t1.PID,
case
when t1.CODE is not null then t1.CODE
else (
select t2.CODE from MYTABLE t2
where t2.PID = (
select max(t3.PID)
from MYTABLE t3
where t3.PID < t1.PID and t3.CODE is not null
)
)
end,
t1.SERIAL
from MYTABLE t1
;