Modal dialog - Access 2007

Yecats131

Registered User.
Local time
Today, 15:06
Joined
Apr 22, 2008
Messages
63
Hello!

I was hoping someone could help me solve my problem. I may just be having a stupid day. :0) I've created a modal to basically work as a quick add for an employee into the database.

Essentally, it'll have two buttons (OKay and cancel).

How do I tell the Okay button to add the information that is typed into the fields to the table? I will then need to have it display the Form that is created w/ the record that was just added showing. Also, I want to have it clear the Modal so that when it is opened the next time it'll be on a "new record" type screen?

I appreciate the help in advance.

Thanks!
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    38.8 KB · Views: 585
Last edited:
Make sure the form is bound to the table, and that all controls are bound to the appropriate fields in that table. That will ensure the record's addition to the table.

To get rid of the modal-type form, use:
Code:
me.modal = false
If you want to then open the form that contains the record you just entered, use the docmd.openform command with a reference the values that were just entered in the table via your modal data entry form.

The method in which you reference those values depends entirely on your data structure.
 
So, here's some stupid questions:

1. Make sure the form is bound to the table

How do I do that? I've taken the controls from the table and "dragged / dropped" them onto the form. Does that equate to the same thing?

2. Why do I want to stop it from being a modal form?

3. If you want to then open the form that contains the record you just entered, use the docmd.openform command with a reference the values that were just entered in the table via your modal data entry form.The method in which you reference those values depends entirely on your data structure.
could you provide me with an example?

Thanks!
 
So, here's some stupid questions:

1. Make sure the form is bound to the table

How do I do that? I've taken the controls from the table and "dragged / dropped" them onto the form. Does that equate to the same thing?
Form Design view > form property sheet > "data" tab > "Recordsource" property = Your Table
2. Why do I want to stop it from being a modal form?
Because, if the form stays modal, you won't be able to do anything else until you close it. Modal forms stay on top. When they are active, they are the only objects that are active. To get rid of them, you have to change they're modal property, or close them.
3. If you want to then open the form that contains the record you just entered, use the docmd.openform command with a reference the values that were just entered in the table via your modal data entry form.The method in which you reference those values depends entirely on your data structure.
could you provide me with an example?
Sure...(enter an orderID on the form called "frmorders", and press one of the two buttons). This might give you an idea of how to handle your individual situation.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom