[AccessD] Add new data to existing table

Darren DICK d.dick at uws.edu.au
Mon Dec 6 22:49:16 CST 2004


Hi Doris
There are a few ways
The zip code control on your form - is a Text Box or a combo box

Anyway the basics of it are......
Test For Existence of zipcode (You are doing that already)
If it exists - then Cool carry on as normal
If it does not then force the User to enter the Details of the new Zipcode,
State and City

Have a message box come up and say something like
That postcode is not in the list or system or database or whatever
Please Add the details for it on the next screen

When they click OK - Have a little form 'popup' with it's Modal property set
to TRUE
Bind this form to the ZipCodes Table and have each of the 
Text boxes on this 'popup' form, bound to the relevant fields in the
Postcodes table.
EG ZipCode, State and City

Have the popup form go to a brand new fresh blank record when it opens.
And then automatically populate this 'new postcode' control in the popup
form with the
Zipcode that can't be found by having some code like this in the OnLoad
Event of the popup form

docmd.GoToRecord ,,acNewRec 
Me.txtPostCode.defaultvalue =
Forms!theFormThatCantFindThePostCode!txtWhateverthePostCodeFieldIs
(Replace theFormThatCantFindThePostCode with the real name of the Cutomers
form that is doing the ZipCode checking)
(Replace txtWhateverthePostCodeFieldIs with the real name of the Zip Code
control on the form above)
Hope this makes sense

It's more complex typing it than it is doing it :-)))

See ya

Darren

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DorisH3 at aol.com
Sent: Tuesday, 7 December 2004 11:43 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Add new data to existing table

I want to apologize ahead of time for my ignorance of Access but I am new to
this and would appreciate any help that would come my way. 

I have a Customer entry form whereby I am entering customer first name,
customer last name, address, zip code, City, State and remarks.  I also have
a ZipCode table where I have  Zip Code, City, State fields. When entering
data into the Customer Entry Form the Zip Code field goes out and looks up
the City and State and returns the value from the table on exit from the Zip
Code field.  
My question is this:  when a value is not found in the Zip code table that
matches the entered zip code, how do I from the Customer entry form add the
new Zip code, City and State to the Zip Code table?

Again, I appreciate any help you can extend me.

Doris
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list