X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Textbox Expression Producing Unexpected Results, Access 2013    
post Jun 17 2019, 03:31 PM

Posts: 9
Joined: 14-March 19

I have a report whose RecordSource is a SQL server view. There is a textbox named FormName-2014 and its ControlSource is Formname (which is a column from the RecordSource).
A recordsource column AmountFromPage1 also exists.

In another textbox, let's call it txtTest, I have this expression: =IIf([FormName]="140A","",[AmountFromPage1])

I expect that when the FormName (represented in the textbox Formname-2014) is 140A, then txtTest will be blank. But, it always shows something. Anything obvious I am missing here or to check?
Go to the top of the page
post Jun 17 2019, 03:41 PM

Access Wiki and Forums Moderator
Posts: 76,081
Joined: 19-June 07
From: SunnySandyEggo


Welcome to UtterAccess!

I'm not sure if you're trying to refer to the content of the Textbox in your expression or the actual field in your Record Source. Or both?

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
post Jun 17 2019, 03:43 PM

UtterAccess VIP
Posts: 6,774
Joined: 30-June 11


FormName is a Reserved Word and should never be used to name anything and can cause weird behaviors when you use it in any manner other than intended. Rename the field and adjust expression and try again.

Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc

All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
post Jun 17 2019, 03:46 PM

Posts: 9
Joined: 14-March 19

Thanks Daniel and dbGuy, I actually converted my expression to vba and stepped through it and realized that me.formname was bringing up the name of the Report - then googled and found FormName to be a (apparently somewhat obscure??) reserved word, about the same time you were replying - thanks again gentlemen.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    24th August 2019 - 10:56 AM