473,386 Members | 1,785 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,386 software developers and data experts.

auto encode

I want to automatically fill in the field values of my Form that uses
a table (DIRECTORY) that has the following fields (sample);
NAME
PHONE
ADDRESS
ZIP
The form has a combo box for ZIP that relates to a Query
using ZIPCODE table that has fields: ZIP, CITY and STATE

At first I was using it as a linked table that automatically
display the values of City and State using [ZIP].[Column](1).

However, I like to add STATE and CITY fields in the DIRECTORY table.
I can't figure out a way to automatically get corresponding values (to use
as default value for city and state) whenever I pick on zip from the combo
box.

help please. thanks.
Nov 12 '05 #1
1 1592
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming that the query for the Zip ComboBox is like this:

SELECT ZIP, CITY, STATE FROM ZipCode

When the record is saved use the Form's BeforeUpdate event to load the
City and State fields in the form's RecordSource. E.g.:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Not IsNull(Me!Zip) Then
Me.City = Me!Zip.Column(1)
Me.State = Me!Zip.Column(2)
End If

End Sub

HTH,

MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP7wXs4echKqOuFEgEQKqzACg3CabIsStf6vLPQHH8QgxUG o0uu0An3Mn
dCDvkKpkmQgJ+d/SmdQHM0aE
=kc9a
-----END PGP SIGNATURE-----

trhq wrote:
I want to automatically fill in the field values of my Form that uses
a table (DIRECTORY) that has the following fields (sample);
NAME
PHONE
ADDRESS
ZIP
The form has a combo box for ZIP that relates to a Query
using ZIPCODE table that has fields: ZIP, CITY and STATE

At first I was using it as a linked table that automatically
display the values of City and State using [ZIP].[Column](1).

However, I like to add STATE and CITY fields in the DIRECTORY table.
I can't figure out a way to automatically get corresponding values (to use
as default value for city and state) whenever I pick on zip from the combo
box.

help please. thanks.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: francescomoi | last post by:
Hi. I'm trying to store a text within a MySQL field (v 3.23.58) by using MySQLdb (v 1.2.1c3). The text is: "telephone..." (note the last character) And I get this error message:...
5
by: Scott Matthews | last post by:
I've recently come upon an odd Javascript (and/or browser) behavior, and after hunting around the Web I still can't seem to find an answer. Specifically, I have noticed that the Javascript...
4
by: Newbie | last post by:
How would I modify this form to encode *all* the characters in the 'source' textarea to the '%xx' format & place result code into the 'output' textarea? (cross browser compatable) Any help is...
3
by: Peter | last post by:
Hi, I try to make up a javascript string which contains numeric numbers in any positions. For example, I want to make a string: secretcode, where secretcode.charAt(0)==(-21),...
1
by: AR | last post by:
I would like to know more about the Encode/Decode feature available within MS Access. This is what I have read from Microsoft Office OnLine: "The simplest method of protection is to encode the...
4
by: Darrel | last post by:
How does HTML.encode work? I'm trying to save text in a hidden form field into a SQL DB. The tedt is HTML (from a WYSIWYG editor...X-standard). One problem I have is that stray apostrophe's in...
7
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I...
6
by: 7stud | last post by:
s1 = "hello" s2 = s1.encode("utf-8") s1 = "an accented 'e': \xc3\xa9" s2 = s1.encode("utf-8") The last line produces the error: --- Traceback (most recent call last):
4
by: J Peyret | last post by:
Well, as usual I am confused by unicode encoding errors. I have a string with problematic characters in it which I'd like to put into a postgresql table. That results in a postgresql error so I...
1
by: anonymous | last post by:
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.