How do I reference a specific record on a continuous form

  • Thread starter Thread starter Steve Roberts
  • Start date Start date
S

Steve Roberts

I have a continuous form called CompanyJournal that has a dtDate field. In
the dtDate field I have an On Double Click event set to open up a form
(frmDatePicker)that contains the datapicker control. After the user selects
a date I need to update the dtDate field in the record that I started from
on the continuous form.

I have tried several variations but can't seem to find the right one. Any
suggestions?

Thanks in advance.

Steve
 
You can add global module variable of type Control:

Public Dim glbDatePickerCtrl As Control

In your onclick procedure, assign that global a reference to your continuous
form text box:

Set glbDatePickerCtrl = Me.dtDate
Call your form.
Set glbDatePickerCtrl = Nothing

In your form, before closing the form, check glbDatePickerCtrl, and if it is
not Nothing, assign the value back to the contorl:

if not glbDatePickerCtrl is nothing then glbDatePickerCtrl = myNewCoolDate

- Igor
 
Back
Top