Nearly finished - just need this one bit of help!

Solaron

Registered User.
Local time
Today, 05:23
Joined
Aug 8, 2002
Messages
13
I've got a form with 2 subforms inside. All linked nicely...

On the main form there are about 10 fields, and the top field is a combo box. When i seletct something from that combo box, all the records update as necessary - nice.

BUT i need to be able to add to that combo box. I only want to use this one screen for pretty much the whole database, as it is a massive database that needs to be kept simple.

So in short - can you, and if so, how can i use a combo box not just to look up values, but to store values.

Cheers
 
Hmm

Just realised that isn't possible.... so i was gooing to have a button that will bring up an input box which will then add a new value to the combo box (or the underlying field in the table)... i know how to bring up the input box and how to assign it an argument, but how do i then add the value of the argument to the field in the table???

Cheers
 
It is better to have two separate combos. One to use for searches and another to use when adding records. You can hide the second one and in the Current event unhide it if the new record property is true:

If Me.NewRecord Then
Me.txtYourCombo.Visible = True
Else
Me.txtYourCombo.Visible = False
End If

This way, the user can't accidentally change the value of the combo for an existing record.

Also, in the AfterInsert event of the form, requery the "lookup" combo so that it picks up the new record.
 

Users who are viewing this thread

Back
Top Bottom