Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Fields Autofilled

Status
Not open for further replies.

surfbum3000

Technical User
Aug 22, 2003
156
US
I created a form named frmAddResource. It has the following fields from a table named tblResourceDir: Agency Name, Address, City, State, Zip Code, Local Phone Number, Toll Free Phone Number, Contact Person, Web Site, and Services.

To assist with data entry, I would like to do the following: When the data entry person enters the Agency Name, all of the remaining fields, except for the Services field, will be autofilled if the entry is in the table already.

Thanks
 
WHY ?

This sounds like a total lack of Normalisation.


If tblResourceDir has the data then all you need to create a table tblResource that has the PrimaryKey of tblResourceDir as a Foreign Key ( as ResourceDirRef ) and then add the Services field.

Don't go duplicating data from one table to another, or duplicating data in multiple records within the same table. The whole point about Relational databases is that it avoids all that.


You manage it by having a form bound to tblResource with a combo box bound to the ResourceDirRef field
The Row source of this combo box is the tblResourcesDir and if the user can't find the right record then handle it using the NotInList event procedure.



'ope-that'elps.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
I guess I did not explain what is being attempted. The form named frmAddResource has as it's Record Source tblResourceDir. The form will be used for data entry into the table. The table is not populated with data. What is desired is when the data entry person types in an Agency Name in the form, the corresponding fields will autofill if that Agency Name has already been entered into the database. This will save time from having to enter the same information twice.
 
Yes that sounds just like what you explained the first time ( or how I interpreted it the first time )

It is the WRONG thing to do.

If multiple fields contain the same data between records then those fields should be hived off into a different table.

Codd Rules etc., Check your Normalisation.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top