OK, well I was expecting a SQL string and a full function, but I'll try and work with what I was given.
There are several ways to proceed:
-- If you have a saved query, then use two function calls to update fields B & C.
Functions :
Code:
Function FN1(TheField As Integer) As String
If TheField = "" Then
FN1 = "A"
Else
FN1 = "Z"
End If
End Function
Function FN2(TheField As Integer) As String
If TheField = "" Then
FN2 = "OK"
Else
FN2 = "Not OK"
End If
End Function
The update query would look like:
Code:
UPDATE Table1 SET Table1.FieldB = FN1([Custid]), Table1.FieldC = FN2([custid]);
------------------------------------
You could combine the two functions into one:
Code:
Function FN12(TheField As Integer, Selector As String) As String
If Selector = "B" Then
If TheField = "" Then
FN1 = "A"
Else
FN1 = "Z"
End If
ElseIf Selector = "C" Then
If TheField = "" Then
FN2 = "OK"
Else
FN2 = "Not OK"
End If
End If
End Function
and the SQL would look like:
Code:
UPDATE Table1 SET Table1.FieldB = FN12([Custid],"B"), Table1.FieldC = FN12([custid],"C");
-----------------------------------------------------
You could do everything in code, creating the SQL "on-the-fly".