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

Combobox that uses a not in list event to open a popup form.

Status
Not open for further replies.

Goaltender

Programmer
Jun 14, 2003
7
CA
I have a payment form (subfrmJoinGroupTraining) that I use to enter payment details. I have a combobox called 'Institution' that when a user types in a new entry the 'not in list' event triggers the 'frmInstitution' form to open so the user can enter the new institution information.
I want the new entry that triggered the 'not in list' event to be put into the field 'InstitutionName' on the 'frmInstitution' form.
When the remaining address fields are entered into the 'frmInstitution' form there is a command button to close the form and set the focus on the combobox 'Institution' on 'subfrmJoinGroupTraining'. I want the combobox to have the newly entered institution so the user can move the focus to the next field without triggering the 'not in list' event again.

Thanks to all that reply,


Thanks
Jim
"Continually learning.....rather be fishing!"
 
In the NotInList event set the response to acDataErrAdded. If, however, the user decides not to add it to the list, then let Response = acDataErrContinue. The public variable "gbolRecordAdded" is set via the form if the record is added, else set to false.

if (msgbox("Does not exist. Do you want to add it?",vbyesno) = vbYes) then

Docmd.OpenForm "formname",,,,,acDialog

If (gbolRecordAdded) Then

Response = acDataErrAdded

Else

Response = acDataErrContinue
ctlComboBox.Undo

End If

End IF
 
Thanks for your reply.

I am however still trying to address other parts of my post.
I want to place the information entered in the combobox into the field InstitutionName on the form that was opened by the 'not in list' event. After updating the remainder of the form, go back to the orginating form and have the combobox updated with the record the user just entered.

Please I need more help with that part than the other.


Thank you again for your reply.


Jim
"Continually learning.....rather be fishing!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top