I changed the structure of the table "tblLockerInfo" - deleted the autonumber field and set the LockerNo field as the PK.
Changed the field type for "tblCrew.Locker_FK" to Long Integer.
Set up relationships - see the Relationships widow.
Created two queries like in my example dB.
Changed the combo box "cmbLockerNo" Row Source...
In code you have two lines
Code:
DoCmd.Close acForm, "frmNewCrew", acSaveNo
DoCmd.Close acForm, "frmNewCrew", acSaveYes
These parameters do not do what you think. They DO NOT save the data, they save changes to the form.
The syntax is
expression.Close(ObjectType, ObjectName, Save)
All you need is
Code:
DoCmd.Close acForm, "frmNewCrew"
DoCmd.Close acForm, "frmNewCrew"
From Help:Save |
Optional |
AcCloseSave |
A AcCloseSave constant that specifies whether or not to save changes to the object. |
Does this meet your needs?