how to replace a line of code by code

A

Alain

Hi,

I would like to modify a line of code by using coding to do it
I have look at the "Module.ReplaceLine" to make it work but cannot.
My goal is to to not open a form if the end user does not want to see it by
checking a checkbox.
the way my db works is
1- open the splash forms to refresh linked tables if need be (FE is on the
end user desktop)
2- close splash and open the switchboard
3- open new form with new information on the db from the swtichboard open
form action (this is the form that need to be opened based on end user
decision)

The other option is for me to create a simple table and insert value when
the checkbox is checked, look up that value and base the open command on that
value but I really would like to expand my knowledge by using the replaceline
function.

Thanks
 
D

Douglas J. Steele

Not only that, but you should probably be distributing your application as
an MDE, and you cannot write self-modifying code for MDEs.
 
A

Alain

Hi Doug,

I do distribute the FE as .mde, I really do not take any chances on that.
Now knowing .mde cannot self-write code, what would be the best way for me
to do what I need ?
Is there anything better to my other solution ?

Thanks
Al
 
K

Klatuu

What you don't say is how and where the user makes the decision on which form
should be opened. If you can describe that, there is certainly a way to do
it.
 
D

Douglas J. Steele

I think the solution you proposed ("create a simple table and insert value
when the checkbox is checked, look up that value and base the open command
on that value") is fine.

You could create a database property and check it, or even use the registry
or an INI file, but I don't see any major advantage to any of those
solutions over your proposal.
 
L

Larry Daugherty

Hi Doug,

I learn a lot from your posts. Keep up the good work!

There might be advantages to different strategies:

If the application is, or might be, used by many users then is it
proper that one user's choice be enforced for all? If not, there
could be a bit flipping war in the use of a very simple table in the
back end. Settings in a simple table in the Front End would be lost
across updates.

If that simple table could be complicated just a bit by having a
record for every user's User Options then it would work. Otherwise,
as you suggested, a ".ini" file local to each front end could serve
the same purpose of saving User Option settings across changes to the
Front End.

HTH
 
A

Alain

Thanks for your answer.
I just went with a simple table and a DLookup to validate if the end user
want to have a form load up at start up process.
Basically, that form is to advise the end user that there are some changes
in the db
Do they want to see that page everytime they open the db, each end user has
a FE copy loaded on their desktop.
 

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

Top