G
Guest
I want to use a form with an activeX Calendar on it [frmCalendar]. There are
many date fields throughout other forms that when dblclicked on would open
[frmCalendar] to allow the user to select a new date. I have this statement
in [frmCalendar] after the new date has been selected [dtCalday] to send the
data to the calling form [frmOpenForm] to the dblclicked field [FieldName]:
[frmOpenForm].Form![FieldName].Value = [dtCalday]
as one example. The data in [] are global variables that would gather the
info at the spot. I cannot figure out how to assign the [frmOpenForm] and
[FieldName] correctly. These are my global variables:
Public frmOpenForm As Form
Public dtCalday As Date
Public FieldName As Field
I believe I have successfully assigned the [frmOpenFrom] correctly with this
statement:
Set frmOpenForm = Forms!frmPatient
but that same technique doesn't seem to work with the [fieldname] variable:
i.e.
Set FieldName = Forms!frmPatient.form!InitialVisit
When my statement is run Access keeps on saying "can't find field
'FieldName' on form"
Can these two areas of this statement be replaced by variables? And if so,
how are they assigned or is there a better way to do this?
Thank you
many date fields throughout other forms that when dblclicked on would open
[frmCalendar] to allow the user to select a new date. I have this statement
in [frmCalendar] after the new date has been selected [dtCalday] to send the
data to the calling form [frmOpenForm] to the dblclicked field [FieldName]:
[frmOpenForm].Form![FieldName].Value = [dtCalday]
as one example. The data in [] are global variables that would gather the
info at the spot. I cannot figure out how to assign the [frmOpenForm] and
[FieldName] correctly. These are my global variables:
Public frmOpenForm As Form
Public dtCalday As Date
Public FieldName As Field
I believe I have successfully assigned the [frmOpenFrom] correctly with this
statement:
Set frmOpenForm = Forms!frmPatient
but that same technique doesn't seem to work with the [fieldname] variable:
i.e.
Set FieldName = Forms!frmPatient.form!InitialVisit
When my statement is run Access keeps on saying "can't find field
'FieldName' on form"
Can these two areas of this statement be replaced by variables? And if so,
how are they assigned or is there a better way to do this?
Thank you