G
Guest
Hi,
I have a form with a button at the bottom. This button is used to run a
data import function. When the button is clicked on, a call is made to a
form which prompts for the name of the input file, then calls the procedure
to run that actually imports the data.
Upon completion of the Import Function, I would like the form to load with
the correct record and data of what was just loaded. My key for looking up
records is RecordLookUpID. I have Global Variable called TempRecordID
which holds the record number generated (or found if the record already
exists in the table and data is just being changed) in the Import Process.
I don't know if the Findrecord code even works, because as soon as you click
the button, it tries to run the Findrecord code before the Openform and
import process is run.
My Button code is as follows for an On Click Event:
DoCmd.OpenForm "File_Prompt_MTSMat_Form"
' Find the newly imported record and load on Form.
DoCmd.FindRecord RecordLookUpID = TempRecordID
What am I doing wrong? I thank you for any help you can give. I must use
this same type of process on several forms.
I have a form with a button at the bottom. This button is used to run a
data import function. When the button is clicked on, a call is made to a
form which prompts for the name of the input file, then calls the procedure
to run that actually imports the data.
Upon completion of the Import Function, I would like the form to load with
the correct record and data of what was just loaded. My key for looking up
records is RecordLookUpID. I have Global Variable called TempRecordID
which holds the record number generated (or found if the record already
exists in the table and data is just being changed) in the Import Process.
I don't know if the Findrecord code even works, because as soon as you click
the button, it tries to run the Findrecord code before the Openform and
import process is run.
My Button code is as follows for an On Click Event:
DoCmd.OpenForm "File_Prompt_MTSMat_Form"
' Find the newly imported record and load on Form.
DoCmd.FindRecord RecordLookUpID = TempRecordID
What am I doing wrong? I thank you for any help you can give. I must use
this same type of process on several forms.