View Full Version : Update Value of Combobox after new Record


AusiNsaNiTy
04-12-2002, 06:31 AM
Hi all,

I've seen similar post with a similar problem but it doesn't answer my question! http://www.access-programmers.co.uk/ubb/frown.gif. I have a form (A97) with a unbound combo box that uses a bookmark to retrieve records. I have another form from a command button where you can add a new record. The combo box value isn't the Primary Key field (PK is a autonumber) but the name of an employee. It has a 2col. SQL lookup with the PK col hidden.

So far i've managed to get the first form to open the 2nd form, add the new user, return to the 1st form and refresh the records so that the new record Autonumber appears in the relevant PK field and the other details.

What I want is that the value of the staff name is the shown in the combo box. I've tried Me.refresh, requery and the best i've managed to do is get the new record on the form but in the combobox I get blank (me.refresh) or the name of the 1st record (with me.requery). Is there a way to get the value of this text field to be the activevalue in the combobox.

I've tried setting the .defaultvalue and .value to the new name but it still comes up blank.

Any ideas or am I asking too much??? Thanks

Peter.

Jack Cowley
04-12-2002, 02:38 PM
See if this article casts some light on your problem:

http://support.microsoft.com/support/kb/articles/Q161/0/07.asp?LN=EN-US&SD=gn&FR=0&qry=q161007&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000