Solved

Need VBS code help again

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

803 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