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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate field from 2 other fields in form and save

Status
Not open for further replies.

DajTwo

Technical User
Jul 17, 2008
157
US
Access 2003, front-back end format.

I have a form 'location_info' populated from table 'tbl_location'.

The table has an autonumber [loc_#] and a index (multiple) [ccan]

What I require is that everytime a new location is created under a ccan the [loc_name] be populated with:

The recourdsource for the field [loc_name] is "=[loc_city] & "-" & [loc_#]"

It works well on the form, requires no input from the user and displayed correctly however it is not saved in the table. I think my record source is wrong

Any help is appreciated.




If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Should have been clearer

The fields are located in a subform populated by a query. All other fields on the subform can be populated by the user and the data is saved in the appropriate table

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Found the solution..

AfterUpdate event of loc_city

Me.[loc_name] =[loc_city] & "-" & [loc_#]"

Loc_name field bound to loc_name in query..

Seems to work..

Looks soo simple but when you dont know, you dont know. :):)

Rewarding to figure it out sometimes. :):)

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top