it is the easy stuff
As I've said in another post, "...Good Chemistry is Lazy Chemistry: If you're beating your head against the wall over a problem, you've missed something easy - step away from the problem..." - The Late Dr. Palma (Chemisty Prof)
The elegant solution:
When the user clicks on the command button to launch the new history event form for the asset.
-The vba code looks at the newest record by date in the
recod set to fetch the value of the last status.
- now a simple lookup on the status table:
-now we have the list for the next allowed states so we can build the query:
This is then set as the record source for the combo-box
Amazing what getting away from the issue will do for the mind.
That wonderfull "IN" of the "WHERE" clause.
Happy Easter
-z
As I've said in another post, "...Good Chemistry is Lazy Chemistry: If you're beating your head against the wall over a problem, you've missed something easy - step away from the problem..." - The Late Dr. Palma (Chemisty Prof)
The elegant solution:
When the user clicks on the command button to launch the new history event form for the asset.
-The vba code looks at the newest record by date in the
recod set to fetch the value of the last status.
Code:
zstrcurrentstat = newestrecord![status_id]
- now a simple lookup on the status table:
Code:
zstrnextallowed = DLOOKUP("NextAllowedStatus","tbl_status","[status_id]=" & zstrcurrentstat)
Code:
zSQL =
"SELECT tbl_status.status_ID, tbl_status.status_name " & _
"FROM tbl_status " & _
"WHERE tbl_status.status_id IN (" & zstrnextallowed & ");"
Amazing what getting away from the issue will do for the mind.
That wonderfull "IN" of the "WHERE" clause.
Happy Easter
-z
Comment