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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top