Utilizing Menu Items on a form

T

Tugger

I'm using Access 2003. I have a main form for data entry, that has buttons to
open other forms to add information pertaining to the main form such as PO
info, Destination info, Trucking Co info.

The problem is this, I or the users start to enter records. On new PO's, the
database may not contain the info needed to complete the record. I created
buttons to open the necessary forms from the main form to put in the needed
information. When the other forms are closed out and return to the main, I or
the users have to click on 'Records' and Refresh, manually. All I want to do
is, when the other forms are closed out, I want the information to be updated
on the drop down menus on the main entry form automatically without losing
the information already entered on the main form.

Thanks.




to see is when I need to use the other forms to enter information that does
not already exist, close the other forms and the Main form is still open, I
want the records to be refreshed. Once the records are refreshed, the drop
down menus on the main form will contain the needed information. Ideally,
when the other forms are closed, the main form will refresh. But can this be
done without losing information already entered in the fields on the main
form?

Thanks.
 
M

Marshall Barton

Tugger said:
I'm using Access 2003. I have a main form for data entry, that has buttons to
open other forms to add information pertaining to the main form such as PO
info, Destination info, Trucking Co info.

The problem is this, I or the users start to enter records. On new PO's, the
database may not contain the info needed to complete the record. I created
buttons to open the necessary forms from the main form to put in the needed
information. When the other forms are closed out and return to the main, I or
the users have to click on 'Records' and Refresh, manually. All I want to do
is, when the other forms are closed out, I want the information to be updated
on the drop down menus on the main entry form automatically without losing
the information already entered on the main form.


You can use the Requery method to update the list in a combo
box or the form.

The typical approach is that the other forms would be opened
in dialog mode to suspend execution of the button's code
until the other form is closed (or made invisible). The
next line of code after the OpenForm line would be
Me.combobox.Requery
 
T

Tugger

Thanks Marshall, I'm not all that savy with code, but will attempt what you
have suggested to see what I come up with.
 
T

Tugger

Marshall, I tried using a macro to refresh the fields needed, all at once. I
placed the macro under the main form properties, got focus. It will not
requery all fields that I specify, even though the macro contains Requery 4
times, each with it's respective field.

Should I then just name each 'Requery' with it's respective control, and
place the respective macro under the Got Focus property of that control? Or
is there a syntax I can utilize to place all controls under one Requery?
 
T

Tugger

I used the name for each macro for each control and placed it in each control
under the Got Focus. It works and I'm a very happy dude!

Thank you!
 
M

Marshall Barton

I'm not sure about using the form's GotFocus event because
I would not try to do it this way. But I can't say it won't
work either. Do you have a reason for not wanting to open
the other forms in dialog mode?

I also can not help you with macros, they're too limited for
me to have ever tried to use them. However, what you've
described sounds like it might be ok, I just can't say that
definitively.
 
M

Marshall Barton

Tugger said:
I used the name for each macro for each control and placed it in each control
under the Got Focus. It works and I'm a very happy dude!


That makes sense. Glad you it sorted out.
 

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