G
Guest
Hi,
I have a form that searches a lot of records. It is both a standalone form
when the user wants to search, but when the user wants to modify the records,
it is embedded in another form that can then edit the records. The editing
process involves much more than a simple unlocking of the tables.
I would like to run some extra code depending on whether the form is a
subform or not. I.e i would like to say something like
if Parent.Name = "EditForm" then
do some extra stuff
else
do this instead
end if
the problem is, when there is no parent form, parent.Name returns an error.
I tried using the Nz function, but the method doesnt return null either,
just throws an invalid refrerence error.
The other option that i have thought of is just adding all of the code from
the lookup onto the other form, but i do not want to do this, as the code is
quite large, and then any changes would have to be done twice.
Any help would be much appreciated,
Ben
I have a form that searches a lot of records. It is both a standalone form
when the user wants to search, but when the user wants to modify the records,
it is embedded in another form that can then edit the records. The editing
process involves much more than a simple unlocking of the tables.
I would like to run some extra code depending on whether the form is a
subform or not. I.e i would like to say something like
if Parent.Name = "EditForm" then
do some extra stuff
else
do this instead
end if
the problem is, when there is no parent form, parent.Name returns an error.
I tried using the Nz function, but the method doesnt return null either,
just throws an invalid refrerence error.
The other option that i have thought of is just adding all of the code from
the lookup onto the other form, but i do not want to do this, as the code is
quite large, and then any changes would have to be done twice.
Any help would be much appreciated,
Ben