You'll have to use a simple WHERE
statement in your SQL. For example:
SELECT tbl.*, tbl.field2, tbl.field5
FROM tbl
WHERE tbl.field2 Is Not NULL AND tbl.field5 Is Not Null;
This will return all fields and all rows, where field2 and field5 are not Null.
EDIT: Since I am more familiar with vba, I would use the following approach to reach the desired output as stated in the comments.
Start by creating the query.
SELECT tbl.*
FROM tbl
WHERE tbl.ID = 12345;
Let's say you name it "qry_record". Afterwards, I would loop through the fields with a recorset, and create a new dynamic sql statement with the fields that have a value.
Dim rs As Recordset
Dim fld As Field
Dim sqlstatement As String: sqlstatement = "SELECT "
Set rs = CurrentDb.OpenRecordset("qry_record")
With rs
.MoveFirst
For Each fld In .Fields
If IsNull(fld.value) = False Then
Debug.Print fld.Name
sqlstatement = sqlstatement & "tbl." & fld.Name & ", "
End If
Next
End With
rs.Close
Set rs = Nothing
sqlstatement = sqlstatement & "FROM tbl"
DoCmd.RunSQL sqlstatement
EDIT: I have tested the code, and made a minor adjustment. Should work fine now on any table in your access database.