Solved

Need VBS code help again

Posted on 2013-02-06
4
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

734 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