SQL problem within Access

Simple Software Solutions

Kella

Referring to the mailmans 'Clean' code i noticed the following:

queryString2 = queryString2 & ShipleyNorwalkStock & " As [Stock] "

Immediately before the FROM line.

Should this not read:

queryString2 = queryString2 & " ShipleyNorwalkStock & " As [Stock] "


I am assuming there is a field called "ShipleyNorwayStock"

David
 
Abusive and offensive comments

Comments made in you previous thread falls greatly outside the context in why you and others visit this forum. If you do not like the way in which Kella is replying then why bother to help. Experience, not only in Access but on the way people try and get over there problems varies. Diplomacy and Patience is a virtue. I have took offence at your comments so I do not know how Kella feels as it was directed to her and not me.

David:cool:
 
I hope your problem is now solved tho :)
 
Comments made in you previous thread falls greatly outside the context in why you and others visit this forum. If you do not like the way in which Kella is replying then why bother to help. Experience, not only in Access but on the way people try and get over there problems varies. Diplomacy and Patience is a virtue. I have took offence at your comments so I do not know how Kella feels as it was directed to her and not me.

David:cool:
I hope you are not referring to any of my comments as I certainly did not mean to cause offence. I have tried several times to explain how to format code when posting. Its not my fault that I find it easier to read when it is posted in a code block.
 
Simple Software Solutions

Sorry Rabbie, I was in know way referring to you. My comments were directed at Mailman solely. And I appologise if you thought they were aimed at you.

David
 
I am assuming there is a field called "ShipleyNorwayStock"

David... No...
queryString2 = queryString2 & " ShipleyNorwalkStock & " As [Stock] "
That would either be, what I posted
queryString2 = queryString2 & ShipleyNorwalkStock & " As [Stock] "
Or
queryString2 = queryString2 & " ShipleyNorwalkStock As [Stock] "


DCrake said:
Sorry Rabbie, I was in know way referring to you. My comments were directed at Mailman solely. And I appologise if you thought they were aimed at you.
I thought as much, I know I am not the most diplomatic of persons. In particular if people are stubburnly ignoring stuff I am showing/asking them.

I appologise to you for offending you, which posts did you find particularly offending tho??
 
Sorry Rabbie, I was in know way referring to you. My comments were directed at Mailman solely. And I appologise if you thought they were aimed at you.

David
Apology accepted. Now lets all move on.
 
Hey everyone, its still not inputting any of the customer information into the "markup" table. and i cant see why
 
For this I suggest you add to your code
debug.print queryString2

Now strip of the Insert into part and past the remainder into a query.
See if it returns any data.
 
Hi I printed it into the debug window, and stripped out the insert etc.

When i run it from the query window it asks me to input the value for "QryPrices.BasePrice" and the results it comes up with show the 1 in the "Use_fixed" column, So to me it seems the Iif mite not be working properly, becuase the iif is meant to say "if Use_fixed does equal 1, then use QryPrices.Fixedprice" and so it shouldnt be asking for the value of QryPrices.BasePrice. Also now when i run the code in normal Access it shows the problem "Too Few Parameters. Expected 1"

Got any more ideas guys? should i post my code?
 
IIF evaluates both the True and the False values every time it is used so it will look for the value of QryPrices.BasePrice even when Use_fixed = 1.

It might be better to write a VBA function to get the required price in the query so you could skip using IIF
 
I think you may be mixing 2 different solution types
This one by DCrake and this suggestion by me.

Do you have a qryPrices ??? Or not??? If you do the column baseprice doesnt seem to excist in that query.
 
It might be better to write a VBA function to get the required price in the query so you could skip using IIF

The problem with VBA tho is, that is is MUCHO slower than the IIF.
 
Hey i think i mite have combined your method mailman and Davids, I do not know how to join tables.
Also, yes there is a query called QryPrices, and yes it does hav a column called "BasePrice", although i have now changed its name to "IntPrice" because of the similarity with "Base Price". But referring to the querym "QryPrices", it is an access query, and am i meant to set it as a variable before using it in the "queryString"? e.g. Dim QryPrices As .... if so what am i meant to set it as. Also am i meant to execute the query "QryPrices" before using it within my "QueryString"??
 
No, no need to set it..

If it is an excisting query you should be able to use it as a normal table...
 
I'm still not getting any further :S. it appears i have combined the two methods, made a union as a query then tried using iifs in the VB query. I am still not gettin any results. it seems like it is not picking up the information from the VB query, to look at the union query. ?? sorry for the late reply. been off work for a couple of days, broke my finger... not fun...
 
Simple Software Solutions

Kella, David back onboard.

WE seem to be making some progress so don't get dejected. Lets take a step back and look at this objectively.

The first part of you QueryString2 is an INSERT command

Create a new code area and paste it into this and change the INSERT to SELECT and take out the TOP 1

Strip out all the the code below the FROM line (criteria)

Put this in a new query and see if it runs ok. If not, try and fix the syntax.

Next one condition at a time add the WHERE criterion to find the fault

Little by little we will eeek out the fault. Once you have it coming up with a list change it back to a INSERT TOP 1 query and run that.

David
 
Hi David,
I have done what you asked, took out the Where statements, and sorted it out until it started workin. and added the where's one by one, and had to input certain variables which are usually inputted from the form. but got it working. I tried to put it back into the VB code, and ran it, and Access just freezes. :S
 

Users who are viewing this thread

Back
Top Bottom