Auto-fill field from related table

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Auto-fill field from related table

Post by Egg 'n' Bacon »

I can foresee our HR almost demanding it, but if it takes losts of time, please don't use up your time for me.

Cheers

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Auto-fill field from related table

Post by HansV »

I'll see if I can come up with something later this afternoon.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Auto-fill field from related table

Post by HansV »

Here is a version with a continuous subform.
There are text boxes on top of the combo boxes to display the current values; the text boxes cover the entire combo box except for the dropdown arrow.
I changed the record source of the subform to a query.
Copy (2) of TrainingDB.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Auto-fill field from related table

Post by Egg 'n' Bacon »

That's the ticket :)

One last question, is it possible to have the 'live' field the last of Combo10

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Auto-fill field from related table

Post by HansV »

What do you mean by that? That the last record in the subform should have the focus when the user moves to another record in the main form?
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Auto-fill field from related table

Post by Egg 'n' Bacon »

Pretty much. Or when the form is opened.

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Auto-fill field from related table

Post by HansV »

You could try this event procedure for the On Current event of the main form (frmRoleRqdCourses):

Code: Select all

Private Sub Form_Current()
  Me.TblCourseRole_subform.SetFocus
  RunCommand acCmdRecordsGoToLast
End Sub
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Auto-fill field from related table

Post by Egg 'n' Bacon »

Thank you so much. That is just perfect.