473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Access Program Problem

5
I am not an expert but I am trying to develope an access program and have hit the following snag:

Using the queries in one of the fields there is an inserted amount say 3, now if that amount exceeds 3 I want to either * by a different number or add an additional amount. How do I do this and how is it written?

I have tried using the IIf and > but then I get stuck as there is no THEN or ELSE in the program.

Hope someone can help

Regards

John
Sep 17 '06 #1
7 1787
PEB
1,418 Expert 1GB
Hi John,

Please give us the SQL of this that you have done... This you can do it by clicking on SQL View of your query...

And give us an exemple with your data so we can walk in your shoes...

:)
Sep 17 '06 #2
PEB
1,418 Expert 1GB
And

IIF has then and has else that is obligatory!


The syntax is:

IIF(Condition, Then value, ELSE VALUE)

:)
Sep 17 '06 #3
Johnny
5
Hi John,

Please give us the SQL of this that you have done... This you can do it by clicking on SQL View of your query...

And give us an exemple with your data so we can walk in your shoes...

:)
SQL View.
SELECT[NoGlassFrames+SashGlass].GlassHtg
From [NoGlassFrames+SashGlass];

So if glass Htg exceeds 0.8 then another factor has to be applied as a olus or as a multiplier.
I surely hope this is clear as I mentioned I am no expert
Sep 17 '06 #4
PEB
1,418 Expert 1GB
So your query can change like this:

SELECT IIF([NoGlassFrames+SashGlass].GlassHtg>0.8,[NoGlassFrames+SashGlass].GlassHtg*0.25, [NoGlassFrames+SashGlass].GlassHtg) AS newGlassHtg
From [NoGlassFrames+SashGlass];

So 0.25 is your multiplier

Is this helpfull?

:)

SQL View.
SELECT[NoGlassFrames+SashGlass].GlassHtg
From [NoGlassFrames+SashGlass];

So if glass Htg exceeds 0.8 then another factor has to be applied as a olus or as a multiplier.
I surely hope this is clear as I mentioned I am no expert
Sep 17 '06 #5
Johnny
5
So your query can change like this:

SELECT IIF([NoGlassFrames+SashGlass].GlassHtg>0.8,[NoGlassFrames+SashGlass].GlassHtg*0.25, [NoGlassFrames+SashGlass].GlassHtg) AS newGlassHtg
From [NoGlassFrames+SashGlass];

So 0.25 is your multiplier

Is this helpfull?

:)
I used the Build function and entered exactly as above and the run result was as follows.
"The Syntax of the Subquery in the expression is incorrect. Check the subquery's syntax & enclose in ()"
Sep 17 '06 #6
PEB
1,418 Expert 1GB
In design View you need to type only:

IIF([NoGlassFrames+SashGlass].GlassHtg>0.8, [NoGlassFrames+SashGlass].GlassHtg*2, [NoGlassFrames+SashGlass].GlassHtg)

And in your regional settings what is the symbol for decimal character?

If this is the virgula, so your expression should be:
IIF([NoGlassFrames+SashGlass].GlassHtg>0,8; [NoGlassFrames+SashGlass].GlassHtg*2; [NoGlassFrames+SashGlass].GlassHtg)

Have a nice evenenig...

:)
Sep 17 '06 #7
Johnny
5
In design View you need to type only:

IIF([NoGlassFrames+SashGlass].GlassHtg>0.8, [NoGlassFrames+SashGlass].GlassHtg*2, [NoGlassFrames+SashGlass].GlassHtg)

And in your regional settings what is the symbol for decimal character?

If this is the virgula, so your expression should be:
IIF([NoGlassFrames+SashGlass].GlassHtg>0,8; [NoGlassFrames+SashGlass].GlassHtg*2; [NoGlassFrames+SashGlass].GlassHtg)

Have a nice evenenig...

:)
Thanks for all your help but it still won't work. I have reduced the problem to a very short program and query as follows.

SELECT Frames.FramesID, Frames.FrameHtg, Frames.FrameWth, Frames.FrameLgt, Frames.FrameCost

IIF([Frames]FrameHtg>0.8,[Frame].FrameHtg*2,[Frame]FrameHtg)
FROM Frames;

This is a paste from the actual insertion and it is returning Syntax error in query.

I am almost desperate so thanks again for your help.

PS I have'nt a clue what a Virgula is!!
Sep 17 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Kahn | last post by:
Good morning: Here is a quick run down of a problem I have been fighting with. Last week ran into a problem with a program and associated dB (Access 97) - where I could no longer open the dB...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
5
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
8
by: Shooter4Life8 | last post by:
I am trying to run a macro from my VB.NET program. Here is my code. Dim myAccess As Access.Application Dim allMacro As String = "ALL-Macros" myAccess.DoCmd.RunMacro(allMacro) I get the error....
9
by: Ron | last post by:
Hi All, I've recently installed a program written in Access 2000 on a laptop. The laptop had an existing Office 2000 Pro which of course included Access. But the program acts oddly (more oddly...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.