Displaying value of a variable on a form

Hello,

I have a bound form which has several text boxes, each box is for a date.  
When the form opens, the Open event (through 5 IF statements) counts & 
increments the number of these boxes that have null values.  I have a 
variable for this count.  I would like to display the value of this count on 
the form.  I have a text box for this.  At the end of the event, I set the 
value of the text box = to the variable which is keeping count.  The event 
runs fine but on the form, the text box displays the following:

#Name?

Can anyone explain why this happens and how to correctly display the count?

TIA,
Rich
0
Utf
9/6/2007 3:00:02 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
3103 Views

Similar Articles

[PageSpeed] 28

I figured it out.  I had the name of the text box set the same as the name of 
the variable.  Changing the name of the text box resolved.

Lesson learned!!!

Thanks

"rich" wrote:

> Hello,
> 
> I have a bound form which has several text boxes, each box is for a date.  
> When the form opens, the Open event (through 5 IF statements) counts & 
> increments the number of these boxes that have null values.  I have a 
> variable for this count.  I would like to display the value of this count on 
> the form.  I have a text box for this.  At the end of the event, I set the 
> value of the text box = to the variable which is keeping count.  The event 
> runs fine but on the form, the text box displays the following:
> 
> #Name?
> 
> Can anyone explain why this happens and how to correctly display the count?
> 
> TIA,
> Rich
0
Utf
9/6/2007 3:08:04 PM
check the following two issues:


1) - the on-open event is too soon to modify bound controls, and likely too 
soon to modify un-bound controls. I would move this code to the on-load 
event.

The on-open event has a "cancel" option, and allows you to 'test' conditions 
of controls and do things in code, and if the form does not meet conditions 
that you happy with, you can set cancel = true, and the form actually does 
NOT load, or appear (nor does the forms on-load event/code run).

So, the on-open event is generally NOT used for code setup, and form setup 
of values..it is ONLY for testing of conditions that would prevent the form 
loading. So,move your code to the on-load event.


2) - the control in which your assigning a value is NOT un-bound, or in fact 
is bound to some field, or expression that is incorrect.

If this is REALLY a un-bound contour, then you should not be seeing he 
"name?". check the data tab of the properties sheet of this control...it 
should be empty if it suppose to just display a value.

You can NOT bind a control on a form to a VBA variable. You have to use code 
to assign he control, or you can bind that control to a function that 
returns the value of the variable.


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com 


0
Albert
9/6/2007 3:10:14 PM
Reply:

Similar Artilces:

Setting a default value?
Is there a way to set a default value in a cell? I have a column that looks at a list of values which are stored on a separate sheet. I would like the value to default to a value on that list. Thanks for your help, Grace how about somehting like a sheet activate event where if target.address then target=sheets("sheet1").range("a2") -- Don Guillett SalesAid Software donaldb@281.com "Grace" <anonymous@discussions.microsoft.com> wrote in message news:b55201c4891f$b32d2bd0$a501280a@phx.gbl... > Is there a way to set a default value in a cell? I hav...

Newbie OLAP pivottable filter and sort on values
Hi, I have the simpliest of cube pivottables: Year as report filter, Products as Row labels and Amount as value. Is there a way to filter (a cube pivottable) rows on values ie "amount > 1000" or "amount <> 0" ? I only find (when rightclicking Products row label) "Filter top 10". /Jerome I use Excel2007 and AnalysisServices2005 sp3 cubes. ...

change column to row display
I have some data that I paste into a spreadsheet that results in a column of data. Is there a way to paste this column data into a row, or can I convert existing column data in a spreadsheet into a row? Russ Assuming you have less than 256 cells of data (unless you're using XL2007) Try this: Select from the SECOND item down through the bottom of the list. From the Excel Main Menu: <edit><copy> Select the single cell to the right of the FIRST item in the list <edit><paste special>...Check: Transpose....Click [OK] Clear the cells under the first cell. Is that ...

How do I create a one variable data table?
Look in Excel's help files for 'one variable data table'. And there's information in the following MSKB article: XL: How to Create and Use One-Input Data Tables in Microsoft Excel http://support.microsoft.com/kb/282855 Prelll91 wrote: -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Unable to type into a CRM 3.0 form
I just switched to a Dell Latitude D610 and am running CRM 3.0 using both browser and Outlook 2003 client. I am working fine when all of a sudden, I can no longer type text onto a CRM form field. I am not locked up. I can still move my cursor, choose from a picklist, etc. I just cannot type into a text field. Any thoughts? May not be related however I have seen this with other web sites/forms. Do you have the google or msn toolbars installed? Try removing them and see if that fixes the problem. May not be related however I have seen this with other web sites/forms. Do you have the g...

Change Actual Revenue display in Opportunity
Can anyone tell me how to change the Actual Revenue display name in Opportunity. This field is on the Close Opportunity screen when you Close an Opportunity. I have located the attribute in Opportunity and change the display name but at the Close Opportunity screen it still states Actual Revenue. Thanks. -- dwoo Hi, Close Opportunity screen is based on system entity "Opportunity Close". Display Name of attributes of this entity cannot be changed. You will have to look for some other workaround to implement required functionlity. Kind Regards, Rohit "dwoo" wrot...

Make cell display 0 if number is negative
Hi, How would I go about making a cell that contains a formula read and display any number less than zero as zero. Can this be done? Any help would be appreciated! Hopefully this will be my last question:c) Ron One way: =MAX(<your formula here>,0) In article <el$#m2WhEHA.384@TK2MSFTNGP10.phx.gbl>, "Ron King" <montyboy@earthlink.net> wrote: > Hi, > How would I go about making a cell that contains a formula read and > display any number less than zero as zero. Can this be done? Any help > would be appreciated! Hopefully this will ...

Form Control and Data
Greetings Forum memebers! I'm new to this board, and thought I'd ask for some advice from the knowledgable people here.. Here is what I am trying to do... I have a workbook with 3 sheets (Sales, Schedule, Data). The idea is that an employee will input the date, customer's name, phone #, and have a drop down with a list of services to select. This would all be included on the Sales sheet. The data for the drop down box is on the Data sheet, and right now only includes the text of the service, no prices. So here is question #1 - How would I make it so that when the employee sele...

Form for inputing criteria for a report's query
I have a report that is based on a query. The criteria for the start date changes and I want a form where I can input the date range (Between #2/2/2006# and #2/4/2006#) each time the report is run. Is there a way to set up the form so that the forms asks for the user to put in the start date and the end date and then put those results in the format above into my query to run the report correctly? Thanks, Robert ryonker wrote: >I have a report that is based on a query. The criteria for the start date >changes and I want a form where I can input the date range (Between >#2/2/2...

Copy subtotals as values
Is there a way to copy subtotals into another spreadsheet as value without getting all the detail behind subtotals? When using filters, we can copy, paste as values and not get any detai not shown under that filter. Is there a way to do the same wit subtotals? Thanks so much for your time. Regards, BG -- Message posted from http://www.ExcelForum.com Hi try the following: - select your range to copy - hit F5, click 'Special' and choose 'visible cells only' - now copy and paste the data -- Regards Frank Kabel Frankfurt, Germany > Is there a way to copy subtotals int...

ListBox and Navigation on Unbound forms
Good morning all, I actually have two questions similiar in relation. First is I have an unbound form with a list box on it called lstData. That is populated by a tbl_Titles. There are several txtBoxes and misc that are populated by the lstData. I have added navigation buttons to the form however I cannot get them to work. Does anyoone have any reference to how to use the First, Previous, Next, and Last record navagation on an unbound form? Second, on the same form I have an unbound txtbox which I want to use to give a record count. I currently am using Dcount method however th...

I want to randomly fill an array of cells with values from a list I create
I have a column of with 4,500 cells. I want the number in the cells to be randomly picked from a list of 2 choices, all predefined (20,27,40,54....296). Can anyone help me with this? Thanks -- Message posted from http://www.ExcelForum.com We probably need a little more information. What's in the 4500 cells? What do you mean by "predefined? What do you mean by "I want the number in the cells to be . . . picked"---"picked" by what? Alan Beban shadestreet < wrote: > I have a column of with 4,500 cells. > > I want the number in the cells to be ...

Opening a form by clicking on a record in a table
Is it possible to click on a field of a specific record of a table in microsoft access and open a form containing information about that record. If so how is it done? Thanks -- BULLDOG253 BULLDOG253 wrote: > Is it possible to click on a field of a specific record of a table in > microsoft access and open a form containing information about that > record. If so how is it done? > > Thanks It's possible to open a form from another form, but not from a table. Tables should never be used for anything after intitial development. -- Rick Brandt, Microsoft Access MVP Emai...

Display Data In Form From A Query
I have a form with the Control Source as "=Query!QTYForPPMProduction!SumOfQTY_PRODUCED" and this query runs prior to the form opening. The query runs fine, and the proper data displays in the datasheet view, but my form Text Box will not show the data. Any suggestions out there? =DLookup("[SumOfQTY_PRODUCED]", "[QTYForPPMProduction]") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GeorgeSoares" <GeorgeSoares@discussions.microsoft.com> wrote in message news:6F2E1E06-8772-4E6F-B1A7-647E14A1A7F0@microsoft.c...

Open Record by selecting on another form.
Hi I have a database that lists outstanding orders customers have, On the event procedure for txtbox Order Number on the currently opened form outstanding orders, I have selected that on double click it will open the form orders to the appropraite record. ie in the outstanding orders if fred has an order and you double click on the order number it opens up freds order from the orders form. I have used a where statement but must have got it wrong can someone point me in the right direction first time I have used the where statement. Private Sub Order_Number_DblClick(Cancel As Integer) Dim ...

Query where 3 Fields must contain same value
I would like to write a query that pulls records where the value in 3 different Columns is the same. Example: Return records where each field below contains same value Return below records Field1 | Field2 | Field3 | 150 150 150 Do not return rows like below Field1 | Field2 | Field3 | 175 26 15 -- Brian Conner Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200911/1 WHERE Col1 = Col2 AND Col2 = C...

Need to add same value to every cell...Is that doable?
I have a spreadsheet that is like a price list. I need to add an amount to every cell. Is there an easy way to do that & have it calculated for me instead of manually calculating it & typing it in? Hi Brita Enter the amount in a empty cell on you sheet Copy this cell Select all the cells Right click on them and choose Paste Special >Add -- Regards Ron de Bruin http://www.rondebruin.nl "Brita" <bmjack@cox.net> wrote in message news:962e01c4d4b3$4f2759f0$a401280a@phx.gbl... >I have a spreadsheet that is like a price list. I need to > add an amount to e...

Displaying decimal places in Access
Can I pursuade Access to show me decimal places on data I have already entered. At the moment everything gets rounded up or down. I've done what is needed to change for future inputing but old data is still not showing what I want. Hoping someone can help jille jille wrote: > Can I pursuade Access to show me decimal places on data I have already > entered. At the moment everything gets rounded up or down. I've > done what is needed to change for future inputing but old data is > still not showing what I want. > > Hoping someone can help > jille What i...

Steps in displaying a UTF-16 BMP value using TextOutW() ???
Assuming that the typeface represents the character in question, exactly what additional steps are required to display a character glyph that is within the Basic Multi-lingual Plane? Do I have to select a specific CharSet that differs depending upon the BMP value? lfCharSet Specifies the character set. The following values are predefined: ANSI_CHARSET BALTIC_CHARSET CHINESEBIG5_CHARSET DEFAULT_CHARSET EASTEUROPE_CHARSET GB2312_CHARSET GREEK_CHARSET HANGUL_CHARSET MAC_CHARSET OEM_CHARSET RUSSIAN_CHARSET SHIFTJIS_CHARSET SYMBOL_CHARSET TURKISH_CHARSET I don't think these actually ap...

Best way to display XML
Hello, i have a big XML file, i load the xml to a xmldocument. My question is, how is the best way to display de information (aspx page). I tryng load the xml into a dataset an then displaying into a grid, but the structure of the xml (combinations of the attributes and nodes) is dificult to take into a dataset, and not represent well de model of the xml. My xml not have allways the same structure, it depends to the parameter that i give a some webservice, and this webservice give a XML resultant to the query. note: I have de schema of the xml Only i need your opinions and experience. Th...

Display/Pull images from web onto form/into table?
Hello: I am experimenting with using Amazon Web Services to pull information into an Access database. I want to be able to use the cover art images Amazon makes available. At this point, I have gotten as far as being able to acquire the URL that points to the image. I thought this would be easy but I am struggling: 1. Is there a way, on a form, to set an image control to display the image using a URL as a pointer? Is the web browser control the only way to do this? 2. Is it possible / really hard to do / easy to somehow actually download the image into the table using VBA? Thanks! F...

Creating flags for certain fields in working Form
Hello, What is the best way to add a flag for specific fields? For example, Field A has a value and depending on the value, the flag could change be a choice such as Yes Or No or even changing the color of that specific cell in the table. Any advice much appreciated in advance. -- Best regards, Donald Ramer donaldramer@comcast.net You and I may not mean the same thing by "flag". If you want formatting changes depending of field value, take a look at "Conditional Formatting". -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://m...

Combo box display
Using A2K, I have 2 combo boxes on a continuous form, cboCompany and cboDescription. After I make a selection in cboCompany, I would like to have only descriptions from cboCompany display for selection in cboDescription. In a query, I looked for descriptions from the form and cboCompany. This works for the first occurrence of the continuous form, but the same descriptions are displayed for each additional line even if a new company has been selected on cboCompany. How can I get this to work? Thank, Dan Hi danc09 After each selection of cboCompany you need to requery cboDecsription ...

Outlook 2002 Inbox failed to display email list
Outlook 2002 failed to display email list in the inbox, "Can't display information in inbox folder.". But it is workable for other folder like " deleted mail". ...

Internet Explorer 7 causes Access XP to fail on loading form with embedded web browser control
I have an Access XP database with a form which displays a web page on loading. Prior to downloading and installing Internet Explorer 7 this worked perfectly. It still works perfectly on another computer on my network which does not have IE7 installed. But when I try and open it using the PC with IE7 it crashes and closes the program. I'm about to uninstall IE7 but if that doesn't work are there any more ideas? Thanks. Jon. On Mon, 17 Dec 2007 14:23:35 +1100, "Jon" <webindexing@optusnet.com.au> wrote: I'm not familiar with this specific problem, but I wou...