Opening a form from combo box to enter a new record

G

Guest

I am developing a cost database where the data will be entered by clerical
personnel. The data is entered in one main form which has a number combo
boxes from other tables such as category, material type, currency etc. If
you enter text in these combo lists which is not already in these other
tables the applicable form for the other table will open and you can enter a
new record there. This all works fine but when I exit that form, the list in
the main form for that control is not always updated with the new record I
entered. Most of them work apart from two which is driving me crazy as they
have all been set up the same way (using On Not in List - OpenForm) Macro
Expression builder). Can anyone suggest what I am doing wrong?
 
B

Brian

Karen Chew said:
I am developing a cost database where the data will be entered by clerical
personnel. The data is entered in one main form which has a number combo
boxes from other tables such as category, material type, currency etc. If
you enter text in these combo lists which is not already in these other
tables the applicable form for the other table will open and you can enter a
new record there. This all works fine but when I exit that form, the list in
the main form for that control is not always updated with the new record I
entered. Most of them work apart from two which is driving me crazy as they
have all been set up the same way (using On Not in List - OpenForm) Macro
Expression builder). Can anyone suggest what I am doing wrong?

If you open the second form using WindowMode:=acDialog, then your code will
stop at the OpenForm statement until the second form is closed. Then, you
can requery the combo box e.g.

DoCmd.OpenForm "frmNewValue",WindowMode:=acDialog 'Code execution
suspended until the form is closed
Me!cboMyCombo.Requery
 
G

Guest

Thanks Brian...that was a great help.

Brian said:
If you open the second form using WindowMode:=acDialog, then your code will
stop at the OpenForm statement until the second form is closed. Then, you
can requery the combo box e.g.

DoCmd.OpenForm "frmNewValue",WindowMode:=acDialog 'Code execution
suspended until the form is closed
Me!cboMyCombo.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top