Using MS Access/Change text box values as tab through datasheet.txt
Expert: Rob Henderson - 2/9/2005
QuestionI put this code ...
DoCmd.RunCommand acCmdSaveRecord
in the On Current Event of the subform. No difference.
AnswerPutting the saverecord code in the current event will have no effect at all on what you're trying to do. Insert your look up code into the on Current event and see what happens.
To confirm;
You want to update three text boxes based on what field value is present in the subform record.
To do this you must have;
1. A saved record the main form can reference to pull back the data for the three boxes
2. Data that corresponds to the data you're retrieving - I.e. something to pull back
It seems to me when you have a saved record and have relevant data to pull back, using DLookUp for example will do exactly what you want - pull the relevant field back into the main form.
Your issue was around not being able to retireve the data from an unsaved record - hence the reason I said to save the record first.
rob