Solved

Need VBS code help again

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

19 Experts available now in Live!

Get 1:1 Help Now