Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datatype mismatch issue 1

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
0
0
US
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
 
What are the data types of tbl_ats_SlsRepPercents.Sls_RepId and tbl_ats_SlsRepPercents.Bill_TypeId ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
all four of them are text with a length of 4
 
all four of them are text
I asked for two ...
Anyway, you may try this:
Code:
Rep1Percent = DLookup("comm_percent", "tbl_ats_SlsRepPercents", "Sls_RepId='" & RSComm!Rep1Id & "' AND Bill_TypeId=[!]'[/!]" & RSComm!Bill_Type_ID[!] & "'"[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top