M
M
I am editing a fields values based on two other fields. I
have code set up to use a Select Case statement to look
for a specified value in two fields.
Here's an example:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim varRespDept As Variant
Dim varXZone As Variant
Set db = CurrentDb
Set rs = db.OpenRecordset("RESTRICTED BALANCE")
With rs
varXZone = .Fields("XZONE").Value
varRespDept = .Fields("RESPONSIBLE DEPARTMENT").Value
Do Until .EOF
.Edit
Select Case varRespDept
Case "" And varXZone = "BB"
varRespDept = "BANKRUPTCY"
End Select
.update
.movenext
loop
end with
etc...
Both fields have text as the datatype. I have tried "",
Empty, Null and everything else I can think of but the
code stops every time with a RunTime error 13 - Type
Mismatch.
And I set the table to accept zero-length strings
Any Ideas?
Thanks
M
have code set up to use a Select Case statement to look
for a specified value in two fields.
Here's an example:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim varRespDept As Variant
Dim varXZone As Variant
Set db = CurrentDb
Set rs = db.OpenRecordset("RESTRICTED BALANCE")
With rs
varXZone = .Fields("XZONE").Value
varRespDept = .Fields("RESPONSIBLE DEPARTMENT").Value
Do Until .EOF
.Edit
Select Case varRespDept
Case "" And varXZone = "BB"
varRespDept = "BANKRUPTCY"
End Select
.update
.movenext
loop
end with
etc...
Both fields have text as the datatype. I have tried "",
Empty, Null and everything else I can think of but the
code stops every time with a RunTime error 13 - Type
Mismatch.
And I set the table to accept zero-length strings
Any Ideas?
Thanks
M