Can anyone say what is wrong with this please:
Private Sub Combo18_AfterUp date()
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT [Height Pixels] FROM [Pictures]WHERE
[Pictures].[Height Pixels] IS NOT NULL AND [Width Pixels]= '" & Me![Combo18]
& "';"
Me![Height Pixels].RowSource = SQLStmt
Me![Height Pixels].Requery
Set R = CurrentDb.OpenR ecordset(SQLStm t)
If R.RecordCount > 0 Then
R.MoveLast
If R.RecordCount = 1 Then
Me![Height Pixels] = R![Height Pixels]
End If
End If
End Sub
Control Source for Combo18 is Width Pixels. The idea is a “smart” default
for Height Pixels field, but I just get “Run-time error 438”
Thanks
Peter
Private Sub Combo18_AfterUp date()
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT [Height Pixels] FROM [Pictures]WHERE
[Pictures].[Height Pixels] IS NOT NULL AND [Width Pixels]= '" & Me![Combo18]
& "';"
Me![Height Pixels].RowSource = SQLStmt
Me![Height Pixels].Requery
Set R = CurrentDb.OpenR ecordset(SQLStm t)
If R.RecordCount > 0 Then
R.MoveLast
If R.RecordCount = 1 Then
Me![Height Pixels] = R![Height Pixels]
End If
End If
End Sub
Control Source for Combo18 is Width Pixels. The idea is a “smart” default
for Height Pixels field, but I just get “Run-time error 438”
Thanks
Peter
Comment