Opening a form from Command Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to know I'm not crazy. In every version of Access I have built forms
in, while adding a record to a form that has a command button to open another
form to add related data, I have always been able to do this without any
special code. All of a sudden with Access 2000, I can no longer open a form
from a command button while adding a new record and enter related
information. I keep getting the error:

A related record in Table1 is required

Am I missing something? I've tried using the me.refresh command on the last
"required" field on the form, but it still doesn't work. Any suggestions
would be very much apreciated!

Glenn
 
mcwilsong said:
I need to know I'm not crazy. In every version of Access I have built
forms in, while adding a record to a form that has a command button
to open another form to add related data, I have always been able to
do this without any special code. All of a sudden with Access 2000, I
can no longer open a form from a command button while adding a new
record and enter related information. I keep getting the error:

A related record in Table1 is required

Am I missing something? I've tried using the me.refresh command on
the last "required" field on the form, but it still doesn't work. Any
suggestions would be very much apreciated!

Glenn

If the second form being opened is intended to enter child records to the parent
record stored in the first form then you have to save the form you are leaving
before opening the second form. Otherwise the parent record doesn't exist yet
(if it was a new one that you just entered). Use...

Me.Dirty = False
DoCmd.OpenForm blah blah...
 
Back
Top