SteveL13
asked on
Type mismatch in VBA code
I get a type mismatch error when I run a report preview using this code:
Me.txtListingsTakenGoal = Nz(DLookup("[ListingsCount ]", "tblMemberGoals", "[TeamMember] = Forms!frmSelectDateRangeAn dMembers!t xtMemberNa me") And "[GoalMonth] = Forms!frmSelectDateRangeAn dMembers!t xtMonth", 0)
I get no error when I just have this:
Me.txtListingsTakenGoal = Nz(DLookup("[ListingsCount ]", "tblMemberGoals", "[TeamMember] = Forms!frmSelectDateRangeAn dMembers!t xtMemberNa me", 0)
Note: The field GoalMonth is a number field in the table.
Me.txtListingsTakenGoal = Nz(DLookup("[ListingsCount
I get no error when I just have this:
Me.txtListingsTakenGoal = Nz(DLookup("[ListingsCount
Note: The field GoalMonth is a number field in the table.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is numeric and the last solution worked but now I have to add another form criteria. I'll post another topic.
Open in new window
If it is a numeric ID:
Open in new window