Solved

Need VBS code help again

Posted on 2013-02-06
4
292 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now