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!

Updating my combo box list

Status
Not open for further replies.

Phil4tektips

Technical User
Jul 18, 2005
89
GB
All,

I have a combo box with name values in. It predicts a name as the user types if they appear in the list. The form then looks up other information stored about that person and populates other fields on the form. The list is sourced from a table called 'tblPersonnelList', there is a new entry form that is used to add all the details of a new entry.

I've called up the new entry form when a new name is entered in the field to make the user enter the details of the new entry. This worked by setting the limit to list property to YES. Then on the Not In List event I called the new entry form.

Details would be entered and the new entry form closed. Trouble is the original form where the name was initially typed would not show the update in the combo list box. For it to appear I had to close the forma nd re-open it, not ideal.

How can I get the form to 'refresh' to show the new data? I had a problem writing in a save command because the combo box is set to limit to list and it wont allow a save with an invalid text in the field.

This ones got me stumped.....many thanks for any help.

~Phil4tektips~
Grant us peace in our days work!
 
Could you please post the code of the NotInList event procedure ?
One common way is to open the new entry form as modal (acDialog) and to set Response = acDataErrAdded

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi,

The Not in List code is:

Private Sub Nameworkpls_NotInList(NewData As String, Response As Integer)

stDocName = "frmPersonnel List"
DoCmd.OpenForm stDocName, , , , acFormAdd

End Sub

It just calls the new entry form up to a enter a new record.

Many Thanks,

~Phil4tektips~
Grant us peace in our days work!
 
You may try this:
Private Sub Nameworkpls_NotInList(NewData As String, Response As Integer)
DoCmd.OpenForm "frmPersonnel List", , , , acFormAdd, acDialog
Response = acDataErrAdded
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Excellent....thats done the trick.

Thankyou for your valued help again PHV

~Phil4tektips~
Grant us peace in our days work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top