Combo Boxes - Updating Them!

SteveC24

Registered User.
Local time
Today, 19:35
Joined
Feb 1, 2003
Messages
444
Hi,

A question very similar to this was asked a little while ago - but my attempt at implementation of the solution failed quite miserably!!!

Anyway - here is my problem:

I have a fish details form (called "frm Fish enter"), which has a subform in it (called "frm Purchases enter - however, in the main form - it is named "Purchases").

In the subform - I have a combobox called "From", where the user selects where the fish was purchased from....this gets it's shop titles from a form called "frm Shop".

The combobox is setup so that the user can double click on the box - and the Shops form will open - if the user then adds a new shop, renames or deletes one, it doesn't reflect the changes in the combobox when the form is closed.

The other big thing with this is that I need the shops form to be able to be opened independantly without errors about not finding the "frm Fish enter" form.

Thanks for anyone who can answer this, much appreciated!

Bye!
 
Since you're storing the shopID users shouldn't be able to delete shops. What problem with the Not In The List Event are you having?
 
Sorry - obviously not explained very well!

At the moment, the user can enter the details of a fish - then select one of the shops that they have already entered into the Shops form as the shop that they bought that particular fish from.

However, if the fish they just bought was from a different shop - one that is NOT In the database, it needs to be added - which can be done by double clicking on the "From" combobox.

My problem is that when you then close the Shop form, the combobox on the fish form is not updated to show the recent changes, unless the form is closed then opened again.

Thanks,
 
I have been trying that, but cannot get it to work. :(

Is there not some code to make the form refresh itself when it gets focus back? I have tried some of the simple code I know, but it hasn't worked.

Thanks,
 
There are two methods you can use to keep data current in a form: refresh and requery.

Refresh does a quick update of data on the current record, and requery completely rebuilds the underlying recordset by running the query again.

You might try something like Forms![frmFishEnter].Refresh in the onClose property of the popup form.
 

Users who are viewing this thread

Back
Top Bottom