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!

Set a value on a subform field with VBA

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a Form and a Subform. The form has a field called "Lesson Name" The subform has a Como box that looks up a Learning Objective from a table. The Objectives are partial sentenances with a | Pipe inserted as a marker. When I select a value from the Combo box I want to use its value concantinated with the Lesson Name value. I have built the concantination and it works perfectly.

I need to set a value on the subform (Learning Objective) to the result of the concantination. I have set the VB to trigger on the Combo Box After Update event to:
Code:
.Value = (Left([LODD], (InStr([LODD], "|") - 1)) & " " & Forms![Lesson Creation Form]![Lesson Name] & "" & Mid([LODD], InStr([LODD], "|") + 1, 50))]

This works the first time through but crashes if I make select another item from the dropdown menu.

Help please.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top