I have this code that errors out on the DLookup line. I have checked and rechecked that the = fields have exact data type info and it errors out with a Datatype mismatch error. I did a query wizard using the same info and it worked fine without error. Can anyone help me with this. It worked fine yesterday.
Do While Not RSComm.EOF
If RSComm!Rep1Id <> "" Then
Rep1Percent = DLookup("comm_percent", "tbl_ats_SlsRepPercents", "Sls_RepId = '" & RSComm!Rep1Id & "' and Bill_TypeId = " & RSComm!Bill_Type_ID)
If Rep1Percent <> 0 Then
RSComm.Edit
RSComm!Rep1_Percent = Rep1Percent
If Bill_Type_ID = 1 Then
RSComm!Rep1_Payment = Rep1Percent * RSComm!InvcAmount
Else
RSComm!Rep1_Payment = Rep1Percent * RSComm!PmtAmount
End If
RSComm!CommPayDate = Forms!frmDoCommissions!EndDate
RSComm.Update
End If
Thank you
Micki
Do While Not RSComm.EOF
If RSComm!Rep1Id <> "" Then
Rep1Percent = DLookup("comm_percent", "tbl_ats_SlsRepPercents", "Sls_RepId = '" & RSComm!Rep1Id & "' and Bill_TypeId = " & RSComm!Bill_Type_ID)
If Rep1Percent <> 0 Then
RSComm.Edit
RSComm!Rep1_Percent = Rep1Percent
If Bill_Type_ID = 1 Then
RSComm!Rep1_Payment = Rep1Percent * RSComm!InvcAmount
Else
RSComm!Rep1_Payment = Rep1Percent * RSComm!PmtAmount
End If
RSComm!CommPayDate = Forms!frmDoCommissions!EndDate
RSComm.Update
End If
Thank you
Micki