A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#NAME? Error on Form



 
 
Thread Tools Display Modes
  #1  
Old July 23rd, 2007, 04:51 AM posted to microsoft.public.access.tablesdbdesign,microsoft.public.office.access.forms,microsoft.public.office.access.formscoding
Rob B.[_2_]
external usenet poster
 
Posts: 29
Default #NAME? Error on Form

I want some form fields to automatically populate with data once another
field on the form is filled in. Specifically, I want a city and state to
fill in automatically once a zip code is entered.

My table tblZipCodes has 3 fields: fldZip, fldCity, and fldState

My query qryZipCodes has an expression, expCitySt, which combines fldCity
and fldState, which looks like, expCitySt: [fldCity] & ", " & [fldState].
The expression produces the desired result in the query

On the form when I enter a valid Zip Code from tblZipCodes, the field that
points to qryZipCodes.expCitySt, just returns #NAME?.

Ideas?


Rob B.
  #2  
Old July 23rd, 2007, 01:59 PM posted to microsoft.public.access.tablesdbdesign
jahoobob via AccessMonster.com
external usenet poster
 
Posts: 228
Default #NAME? Error on Form

From Access Help:

Make sure that the field specified in the control's ControlSource property
hasn't been removed from the underlying table or record source (record source:
The underlying source of data for a form, report, or data access page. In an
Access database, it could be a table, query, or SQL statement. In an Access
project, it could be a table, view, SQL statement, or stored procedure.).
Check the spelling of the field name in the control's ControlSource property.

If you specified an expression (expression: Any combination of mathematical
or logical operators, constants, functions, and names of fields, controls,
and properties that evaluates to a single value. Expressions can perform
calculations, manipulate characters, or test data.) in the control's
ControlSource property, make sure that there is an equal sign preceding the
expression.


Rob B. wrote:
I want some form fields to automatically populate with data once another
field on the form is filled in. Specifically, I want a city and state to
fill in automatically once a zip code is entered.

My table tblZipCodes has 3 fields: fldZip, fldCity, and fldState

My query qryZipCodes has an expression, expCitySt, which combines fldCity
and fldState, which looks like, expCitySt: [fldCity] & ", " & [fldState].
The expression produces the desired result in the query

On the form when I enter a valid Zip Code from tblZipCodes, the field that
points to qryZipCodes.expCitySt, just returns #NAME?.

Ideas?

Rob B.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200707/1

  #3  
Old July 25th, 2007, 05:37 PM posted to microsoft.public.access.tablesdbdesign,microsoft.public.office.access.forms,microsoft.public.office.access.formscoding
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default #NAME? Error on Form

The easiest way is to use a combo box to enter the Zip code. Add the other 2
columns to the query or select statement which is the row source for the
combo, then use the AfterUpdate event of the combo to "push" the data into
the 2 other text boxes. The field index for a combo is a 0 based array so:

Sub cboMyCombo_AfterUpdate()
Me.fldCity = Me.cboMyCombo.Column(1)
Me.fldState = Me.cboMyCombo.Column(2)
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Rob B." wrote in message
...
I want some form fields to automatically populate with data once another
field on the form is filled in. Specifically, I want a city and state to
fill in automatically once a zip code is entered.

My table tblZipCodes has 3 fields: fldZip, fldCity, and fldState

My query qryZipCodes has an expression, expCitySt, which combines fldCity
and fldState, which looks like, expCitySt: [fldCity] & ", " & [fldState].
The expression produces the desired result in the query

On the form when I enter a valid Zip Code from tblZipCodes, the field that
points to qryZipCodes.expCitySt, just returns #NAME?.

Ideas?


Rob B.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.