Forms :: IIF Statement Within A Field In A Form Not Working

Jun 21, 2013

I am trying to created an IIF statement in a field I have in a form.

I have entered the following statement but it keeps coming up with the following error and I cannot see where I am going wrong.

The expression you entered contains invalid syntax, or you need to enclose your text data in quotes

=IIf([RenewalInstallment]=0,(12-[MFAccepted])*[CurrentAnnualPremium]/12)*(1-[DiscountAccepted]/100),IIf RenewalInstallment]<>0,(12-[MFAccepted])*[RenewalAnnualPremium]/12)*(1-[DiscountAccepted]/100)

If I enter the first part of the If statement i.e.

=IIf([RenewalInstallment]=0,(12-[MFAccepted])*[CurrentAnnualPremium]/12)*(1-[DiscountAccepted]/100)

The field calculates correctly however there seems to be something wrong with the nested if.

View Replies


ADVERTISEMENT

Forms :: IIF Statement On A Field In Form

May 11, 2013

Is it possible to have a IFF statement on a field in a form?

If there is a field number in a form, can an IFF statement be used to check that value. IFF "field" <= 10, Then it the field highlights red.

View 1 Replies View Related

IIF Statement Not Working

Aug 3, 2006

Expr1: (IIf([FixedExpenseOccurance]="Quarterly",[amount]/3,0))+(IIf([FixedExpenseOccurance]="SemiAnnually",[amount]/6,0))+(IIf([FixedExpenseOccurance]="Yearly",[amount]/12,0))

FixedExpenseOccurance is the the field and "*" is the values which get looked up from a table. I am trying to create an expense report. The query runs but no values are entered into the box?

For some reason it is asking for a parameter when I try t orun it. I don't have anything entered into the Criteria.

View 10 Replies View Related

IIF Statement Not Working

Nov 23, 2007

hi i am trying to use the following iif statement in a query.

IIf([Forms]![MainForm]![cmb_ExcessStatus]="Resolved",1,IIf([Forms]![MainForm]![cmb_ExcessStatus]="Outstanding",2,IIf([Forms]![MainForm]![cmb_ExcessStatus]="All Records",([MainTable].[Status])=1 Or ([MainTable].[Status])=2,([MainTable].[Status])=1 Or ([MainTable].[Status])=2)))

So, if user selects 'Resolved' then use 1
if the user selects 'Outstanding' then use 2
if the user selects 'All records' then i want both 1 and 2 but this will not work. i also want the default to be 'All records'

Any help would be much appreciated.

View 1 Replies View Related

IIF Statement Not Working

Aug 3, 2006

Expr1: (IIf([FixedExpenseOccurance]="Quarterly",[amount]/3,0))+(IIf([FixedExpenseOccurance]="SemiAnnually",[amount]/6,0))+(IIf([FixedExpenseOccurance]="Yearly",[amount]/12,0))

I have this in a query and the query runs, it just doesnt do anything. FixedExpenseOccurance is the field name, "*" is the field values (they get looked up from a table). Any clues why this is not working?

For some reason it is asking for a parameter when I try t orun it. I don't have anything entered into the Criteria.

View 8 Replies View Related

If Statement Not Working

Aug 10, 2006

(IIf((NextActivtion)>=(Today)),((DueToday)="yes"),((DueToday)="No"))

Says I have the incorrect number of Arguments? Any clues? These are all field name:
NextActivation (Is a date)
Today (is today's date)
DueToday (is a yes/no)

View 13 Replies View Related

Simple Sql Statement Not Working

Mar 2, 2008

i have an sql statement:

aa = "hello"

Tasklist.RowSource = "SELECT [Tasks].Staff_Name, [Tasks].Project_Title, [Tasks].Percentage_Complete FROM [Tasks] WHERE [Tasks].Date_Allocated < aa ORDER BY [Tasks].Staff_Name;"


how can i make it look the the data i put in "aa" rather than prompt a msg box asking for "aa"?

View 5 Replies View Related

If Statement In A Query Not Working?

Oct 9, 2005

hi im trying to do the following if statement in a query but its not working, anyone know what im doing wrong?
any help would be great.

-------------------------------------------------------------------------
New: IFF [(TABLE-SALES]![PERIOD]<=[TABLE-AVERAGE]![ACTUALS_TO_PD] then [TABLE-SALES]![ACTUALS_TO_PD]) else
[TABLE-UPDATE]![FORECAST_1_BASE_VALUE]

------------------------------------------------------------------------
im trying to say if the field "period" in the table: "TABLE SALES" is the same or less than the value in the field "actuals to pd" in the table :"TABLE-AVERAGE" then the value displayed in this field ("new") should be the value: "actuals to pd" in the table "table-sales" otherwise the value in the field "forecast1 base value" in the table "table update"

View 4 Replies View Related

Between Statement Not Working Using Dates

Apr 5, 2006

Hi,

I am using an ADO connection to an access Db but am having from executing a query on the table.

In my table I have a Field named [Date] with Data Type as Date/Time (Short Date dd/mm/yyyy). When I perform a Query on the Db like;


SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] LIKE '28/03/2006'


The above works fine and produces results, but if I do the following - then it come up with error - data tyle mismatch;


SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] = '28/03/2006'


Any Ideas Why? TIA

View 1 Replies View Related

Between Statement Not Working Using Dates

Apr 5, 2006

Hi,

I am using an ADO connection to an access Db but am having from executing a query on the table.

In my table I have a Field named [Date] with Data Type as Date/Time (Short Date dd/mm/yyyy). When I perform a Query on the Db like;


SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] LIKE '28/03/2006'


The above works fine and produces results, but if I do the following - then it come up with error - data type mismatch;


SELECT [Date], [Part No], [Batch Qty] FROM [Speed Fastener Packing] WHERE [Date] = '28/03/2006'


Any Ideas Why? TIA

View 3 Replies View Related

Insert Into Sql Statement Not Working.. Help!

Dec 5, 2006

hi guys i have a form that comes from a query with a parent and child table. Main table pk is pricingid and then the foreign key in tblHistory is pricingid.

I am trying to do an append table but i keep getting an error message
Pricing ID is the pk autonumber in tblPricing (parent table)
historyid is the pk in tblHistory and pricingid the fk(child table)
oldprice should be a currency value
the other fields are text.

this is my code:

strSQL = "Insert into tblHistory (DateChanged, Edit_UserName, OldPrice) Values(#" & now() & "#, '" & getusername() &"', " & Me.txtPrice.OldValue & ")


but i get the error message


You cannot or change a record because a related record is required in table tblPricing


any advise... i know i need to select somehow the pricingId from the parenttable, but how do i do that?

View 8 Replies View Related

Modules & VBA :: If And NZ Statement Not Working In Access?

Jul 8, 2015

why this IF and Nz statement in my code below is not working. I know the me.txtrefNo value is "" (null) on a form field with property set to General Number. Therefore the Nz statement should return a "0" as I specified making the statement true as in 0 = 0 and then execute the actions below to generate a reference number however this it now happening as it's rendering the if statement as false and showing me the message " Whats going On?" which is after the else statement.

Code:
If Nz(Me.txtrefNo, 0) = 0 Then
Me.txtrefNo = DMax("[refNo]", "[R_P_Data_P]") + 1
tmpRefNo = Me.txtrefNo
'testing variable value
MsgBox (tmpRefNo)
Else
MsgBox ("What's going on?")
End If

PS. Does this have anything to do with the table field format that the me.txtrefNo value will be saved to?

View 2 Replies View Related

Forms :: Formula Not Working - Empty Field Returning

Jan 31, 2014

I have a date in "date to engineering" of 13/ 01/2010 but I am not getting a value in my field which should be 1479 my field is just always returning an empty field

Code:
=IIf(IsDate([date to engineering]),"",IIf(IsDate([date from engineering]),Now()-[date to engineering],[date from engineering]-[date to engineering]))

View 4 Replies View Related

General :: IIF Statement - Calculated Fields Not Working

Apr 8, 2015

Access 2013

I've created a table for a college project and realised that one of my calculated fields isn't working. It doesn't produce an error message, it just doesn't calculate.

IIf([CycleSpeed]<10,[CycleTime]*236,IIf(10<=[CycleSpeed]<12,[CycleTime]*354,IIf(12<=[CycleSpeed]<14,[CycleTime]*472,IIf(14<=[CycleSpeed]<16,[CycleTime]*590,IIf(16<=[CycleSpeed]<=20,[CycleTime]*708,IIf([CycleSpeed]>20,[CycleTime]*944,0))))))

View 6 Replies View Related

Forms :: Form Working Properly Alone / But Gives Error When Combined With Other Forms

Jun 5, 2015

I have a form "NewMetalF" that has three combo boxes. The first one is used to choose "Precious Metal" or "Base Metal". The second one shows all the metals based on the first combo box. When I open the form in form view alone the combo boxes work flawlessly. I run the form "NewMetalF" within another form "NewExternalPartF" by clicking a button "AddMetal". When the button is clicked "NewMetalF" opens. The first combo box is selected, and when the second combo box is clicked the error "Enter Paramater Value" "Forms!NewMetalF!cboPreciousOrBase".

View 13 Replies View Related

Duplicate Record Command Button Not Working For One Form But Is Working For Other Form

Jan 15, 2015

I have an Access 2010 database with two tables and two forms. The tables are Organizations and People. Similarly, the forms are Organizations Entry Form and PeopleEntryForm. The People are linked to the Organizations table. Several people can be linked to the same organization.On my Organizations EntryForm, I created a command button to duplicate a record using the wizard. It works fine.

I did exactly the same thing on the PeopleEntryForm, but instead of copying the record, it creates a new blank record. I don't get any error messages. Is my problem due to the fact that the People table is linked to the Organizations table?

View 13 Replies View Related

Forms :: DateDiff Function Not Working In A Form

Aug 14, 2014

I have a specific question on the datediff function.

My example is =DateDiff("d",[Policy Issue Date],Date()) where [Policy Issue Date] is the inception date of an Insurance Policy.

I need to determine how many days the policy has been inforce. The formula works great in a query and I can see the number of days in that field when the query is run.

However, my dilemma is I want the same function to run off of a text box using its control source property and have the number of days calculate and be visible for each record on the form. This part is not working and the field is returning the #Error? message.

View 5 Replies View Related

Forms :: Down Arrow Key Not Working On Split Form

Dec 19, 2013

When I select a row on a split form I would like the up and down arrow keys to move to the previous and next record. However this isn't happening.

When I select a row and press the down arrow nothing happens.

I have the navigation buttons set to no because of the issues I'm having with them.

How to get the up/down arrow keys to work on a split form??

View 3 Replies View Related

Forms :: Form Load Calculation Not Working

May 12, 2015

I have a bound form to an invoices table. The form details all invoices raised, all payments made and an outstanding balance. The outstanding balance control is just a basic text box.

On form load, I go to the payment table and select all payments into a recordset, I then add up all payments and use the following calculation:-

Balance = InvTotal - paytotal

The Invtotal is the control on the form that has it's control source set as sum(invoicetotal)

The calculation used to work and the correct balance was displayed, indeed, for one particular client, the calculation works, but for all others, the summed value is blank and so the balance is effectively set to the paytotal value.

I know this is to do with the timing as the form loads and it's records/data are made available, as I have an update button that does exactly the same things as the form load and when pressed, all numbers work.....primarily because the summed invoicetotal value is now available in the form control.

I can see what is happening, but not sure why...I thought that form load gave you all records and would have populated the summed control before triggering the load event....obviously not.....

View 9 Replies View Related

Forms :: Pop-up Form Based On If Then Statement?

Jul 30, 2014

I need a pop-up form that is based on an if then statement.

For example if there is a certain customer selected on the form and the detailed bill is more than 10 lines long (I have a count field) then I need a box to pop-up that says....

REMINDER: You will need to manually reformat this 500byte file.

I also need another one that pops-up when the record loads that warns if a purchase order field is blank.

View 4 Replies View Related

Forms :: Using IIF Statement On A Continuous Form

Jul 19, 2013

I have a continuous form sfrmAddress which is based on my table tblAddressList. What I am trying to achieve concerns the date fields DateFrom and DateTo.

DateFrom is a bound text box txtDateFrom

I am trying to put an IIf function in the Control Source of unbound text box txtDateTo

=IIf([txtDateFrom]=[qryAddressHistory1]![LatestFromDate],Date(),[tblAddressList]![DateTo])

qryAddressHistory1 returns the LatestFromDate , so the most recent address.

The idea being if it is their most recent address, they have lived there until today, if it is not their most recent address it will display the date contained in the table (when they moved out or DateTo).

I have tried this a few different ways, double and triple checked my references and I'm usually OK with IIf so I don't understand where it's going wrong!

I should add I'm getting the #Name? error all the way down the column when I open the form.

View 3 Replies View Related

Forms :: Expressions Not Working On 2010 Form Controls

Aug 13, 2013

I've just started using 2010 and, unlike previous versions, the expressions that I've put on controls in a form are not working. Is there a setting that has to change that's new to 2010?

View 5 Replies View Related

Forms :: Spell Check On Form Not Working Like Access Says?

Jun 28, 2013

If you look at the attachment in access settings it says it is set how to auto correct and "INDICATE SPELLING".

in my forms/tables/queries... it will not bring up spelling mistakes or the sort.

View 2 Replies View Related

Forms :: Combo Box - Search Function Not Working Within Form

Jul 23, 2015

I recently created a database to be used to store incoming invoices. We have 4 suppliers which supply the same material and wanted each supplier to have its own database.

I began by making a database which included all the key tables, forms, queries and functions I would need to then save 4 copies, one for each supplier. This just meant I would not have to repeat the process for each individual supplier.

The problem is all my data is external and upon importing it into the database it has made the search function (combo box) not return results.

I believe this is because:
1) The form was created before the records existed
2) The records were imported from an external source and not created using the form.

However, the way I have designed the form is so I can see all relevant information linked with a specific invoice. This aids in gathering information quickly about an invoice but also so I can input credit note and invoice query information linked to a specific invoice on the same page.

Is there anyway to remedy this?

Or use a similar search function that returns records in my form "Main View"

The last thing I want to do is have to create the form again, although I don't think this will work either as reason 2) states.

View 14 Replies View Related

Forms :: Using Split Form With Datasheet - Find Not Working

Nov 9, 2013

I'm using a split form with the datasheet on the left.

When I use the 'Find' in the Navigation buttons at the bottom of the form, it refuse to find text in a particular text box.

The text box is a memo field and is enabled.

Example:

I have text in the memo field which is a title of an episode - "The Outcast."

When I start typing "the" it finds this text in the memo field. But when I type the entire title it the finds the text in another field. ie "out."

I've tried the 3 different Search setting in options. When I use the Find command from the ribbon it work ok as long as I select the text box to search in first.

View 1 Replies View Related

Forms :: Requery Not Working In A Form With Combo Boxes

Jan 30, 2015

New to access...just build a form, in which there are combo boxes....cascading of boxes was done.

Now the problem is I want afterupdate function to get activated when user changes the value of one combo....for which I have created a code in code builder... see the code... I think I am making a mistake in writing the code to requery...

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved