Solved

Need VBS code help again

Posted on 2013-02-06
4
314 Views
Last Modified: 2013-02-06
For onprint event of a report this code has been working:

Me.txtApplied = Nz(DSum("[AppliedInvQty]", "tblOpenOrders", "[Part_No] = '" & Me.txtPart_No & "' AND [Complete] = 0"))

But when I add the RecID info at the end it is broken.  I get a type mismatch error.

Can someone spot my code mistake?

--Steve
0
Comment
Question by:SteveL13
  • 2
  • 2
4 Comments
 

Author Comment

by:SteveL13
ID: 38860913
I forgot to give you my code:

Me.txtApplied = Nz(DSum("[AppliedInvQty]", "tblOpenOrders", "[Part_No] = '" & Me.txtPart_No & "' AND [Complete] = 0" And [RecID] = Me.txtRecID))
0
 
LVL 26

Accepted Solution

by:
jerryb30 earned 500 total points
ID: 38860940
Me.txtApplied = Nz(DSum("[AppliedInvQty]", "tblOpenOrders", "[Part_No] = '" & Me.txtPart_No & "' AND [Complete] = 0 And [RecID] = " & Me.txtRecID))
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38860944
if RecID is text:
Me.txtApplied = Nz(DSum("[AppliedInvQty]", "tblOpenOrders", "[Part_No] = '" & Me.txtPart_No & "' AND [Complete] = 0 And [RecID] = '" & Me.txtRecID & "'"))
0
 

Author Closing Comment

by:SteveL13
ID: 38861021
Perfect.  Thank you very much.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question