Advertisement

06.27.2008 at 11:56AM PDT, ID: 23522681
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Visual Basic Code Run-time Error 3075 MS Access

Asked by jdol2949 in Access Coding/Macros, Microsoft Visual Basic.Net, SQL Query Syntax

Tags: , ,

MS Access 2003
I'm somewhat new to VBA coding so please bear with me.   The snippet I have below is supposed to create a button that will fill in fields for a table using data from another table.  The four fields that I want to insert are BatchNumber, BatchPartSKU, PartQty, & NetQty.  Previously to what I have below, the line:    
 strSQL = strSQL & " tblBOMParts.ReplacePercentage +1 * " & Me!BatchToBuildQty (supposed to relate to NetQty)
wasn't included, and the fill-in worked just fine.  As I said, I am a rookie at this, but I would like the above line to find the replacement percentage located in tblBOMParts, add 1 to that percentage, then multiply that number by the build quantity entered at the top of the form.  The error I'm receiving is as follows:
Run-time error '3075':

Syntax error (missing operator) in query expresson
'tblBOMParts.ItemQty * 60 tblBOMParts.ReplacePercentage +1 * 60

Where 60 is the number entered as the build quantity.  How do I separate the above two expressions so as to have the 4 fields migrated to table tblBatchParts, two of which are calculated?

Thanks!
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Private Sub cmdAddParts_Click()
'dimension all variables
Dim strSQL As String
 
'make sure the user entered BatchItemSKU and BatchToBuildQty first
If IsNull(Me!BatchItemSKU) Or IsNull(Me!BatchToBuildQty) Or Me.BatchToBuildQty.Value = 0 Then
    MsgBox "Please select a B.O.M. SKU and an Expected Quantity first.", vbCritical, "Can't Add Parts"
Else
    'Now build the SQL to insert the rows into tblBatchItems
    strSQL = "INSERT INTO tblBatchParts ( BatchNumber, BatchPartSKU, PartQty, NetQty )"
    strSQL = strSQL & " SELECT " & Me!BatchNumber & ", tblBOMParts.ItemNmbr, "
    strSQL = strSQL & " tblBOMParts.ItemQty * " & Me!BatchToBuildQty
    strSQL = strSQL & " tblBOMParts.ReplacePercentage +1 * " & Me!BatchToBuildQty
    strSQL = strSQL & " FROM tblBOMParts WHERE BOMPartNum = '" & Me!BatchItemSKU & "';"
    
    'turn off warnings so the user doesn't get a popup
    DoCmd.SetWarnings False
    
    'Execute the SQL code
    DoCmd.RunSQL strSQL
    
    'turn warnings back on
    DoCmd.SetWarnings True
    
    'Refresh the SubForm
    Me!sfmBatchParts.Requery
 
End If
End Sub
[+][-]06.27.2008 at 12:11PM PDT, ID: 21886770

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.27.2008 at 12:24PM PDT, ID: 21886856

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 12:35PM PDT, ID: 21886931

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 12:44PM PDT, ID: 21887013

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 12:55PM PDT, ID: 21887086

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 12:55PM PDT, ID: 21887088

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 01:21PM PDT, ID: 21887286

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 01:54PM PDT, ID: 21887544

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 02:01PM PDT, ID: 21887621

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 02:11PM PDT, ID: 21887694

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 02:16PM PDT, ID: 21887742

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 05:45PM PDT, ID: 21888576

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 06:58AM PDT, ID: 21899173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 07:14AM PDT, ID: 21899289

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Visual Basic.Net, SQL Query Syntax
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: capricorn1
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.30.2008 at 08:19AM PDT, ID: 21899944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2008 at 08:23AM PDT, ID: 21900000

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.30.2008 at 09:35AM PDT, ID: 21900671

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628