Updating info in one form, so it shows in another coming from the same table

Nats

Registered User.
Local time
Today, 10:51
Joined
Jun 21, 2007
Messages
26
I have created one main form called 'Employee Details' which comes from the 'Employee Details table'.

I have also created a second form which has a field called 'Employee No' this field is a combo box (the information for this combo box comes from the 'Employee no' field in the 'Employee Details table'.

The 'Employee Details form also has a field called 'Employee No' which comes from the 'Employee Details Table' (so the info is coming from the same place).However it is not a combo box, (Just when I enter a new number it updates that table - so a normal text box).

In the 'Employee Details Form' I have a command button that takes me into the second form.

What I want to be able to do is when I type a number in the 'Employee number field' in my Employee Details Form, for me to be able to click save and then click on the command button to take me into my second form and then when I click on the arrow for my 'combo box' for the 'employee no field' it has at the top of the list the number I just put in the 'Employee Details Form' already in the list.

However, the combox box only seems to update the list when I save and come out of my 'Employee Details Form' and then go back in.

Thank you in advance for your help.
 
Probably the easiest way to do this would be to make sure that the option for "Record Selection" is enabled in the Form Properties.

when you make changes in the active record, simply clicking the record selector will write the changes to the record.

You could also write steps into the code foe the button that closes and then opens the main form before it opens the second form. Closing the form also writes the changes to the record.
 
Thanks for your help on this. I have had a look at my 'record selector' in the second form and it is already on 'yes' and on the first form.

I went into the form did 'design' then clicked 'properties' then went to 'all' and down to 'record selector'. Is this what you meant?

Would you mind doing a step by step of how you would do this?? as I also don't understand what you mean about click the 'record selector' to update this.

My database for others to use so would you suggest maybe the other way you suggested the easier option?

Thank you for all your help so far.
 
If the option for "Record Selectors" is set to YES, then that is all you need.

When you look at the form it depends on the layout you've selected for the form as to where the actual record selector is located.

Commonly, it will be along the left side of the form by default.

If the user simply clicks the bar that represents the Record Selector, the changes are then written to the record in the underlying table.

One give away as to locating the record selector is to change a value in the record, and then look for the "pencil" symbol. Clicking the pencil should change it to a Right Pointing arrow which symbolizes the record has been saved.

As for ease of use, that is pretty easy to do, but capable of error in that the user could forget to click the pencil before they open the second form.

To prevent that possibility, simply add code to your VBA, or steps to your macro that closes and then reopens the first form when the command button is clicked.
 

Users who are viewing this thread

Back
Top Bottom