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

Update one field based on value entered into anther via form...

Status
Not open for further replies.

jwkolker

Programmer
Jan 9, 2003
68
US
On Event Update - of the value in a form field called [namechange] which is tied to a field [pts-users].[username] I want to update
another form field [nameconfirm] that is tied to field [pts-users].[userid] to be the associated UserID Number - in other words using
this data set:
Code:
username                userid

Tom                      1
Bob                      2
Sue                      3
Sam                      4
Jon                      5
Biff                     6
If I change the form field namechange from Tom to Biff - then the form field nameconfirm should automatically update the userid from
1 to 6 and the data should then apear in the table as username = Biff and userid = 6 (Biff's userID) - I suspect that I should use
on update event on the form field namechange and use dlookup to find the associated userid for the changed to name but I'm stumped

Please help out if you can with VBA sample.

Regards,

jwkolker@comcast.net
John Kolker
Programmer
jwkolker@comcast.net
 
Hi,

What's the primary key field in this table?

Nameconfirm is tied to UserId - how?
Namechange is tied to Username - how?

If UserId is primary key, you can't do this.

If no keys are involved, then there are a few events to make what you want happen, can you explain 'tied' first though?

Regards,

Darrylle


"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top