By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Updating Code From a Form

P: n/a
Hello,

Im using redemption in a database created in ms access.

At the moment emails are generated depending on various actions within
a database. To give an example:

Public Const Email_StencilOrderer = "CA" 'Joe Bloggs

Then later on when an action is taken I will call this like so:

Call Email.SendMessage(GetEmail(Email_StencilOrderer), "Please order
stencil number " & stencilNumber & ".", "xxxx," & vbCrLf & vbCrLf &
"Please order stencil number " & stencilNumber & " (" & customer & " -
" & product & ")! The data is found in \xxxx\" & stencilNumber & " and
you can find other information (how the board is panelised, etc) using
the xxxxxxx' icon on your desktop." & vbCrLf & vbCrLf & "Ta!", False)

The problem is that people could well be changing jobs quite soon and I
wanted an easier way of updating the list of people who do various
tasks.

I'm thinking (sadly) that im going to have to create a table and have
everything in there which is going to mean a lot of re-coding.

I've never heard of a form updating code, but thought I'd ask anyway..

Ta,

Chris.

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<ch****@cemgraft.co.uk> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hello,

Im using redemption in a database created in ms access.

At the moment emails are generated depending on various actions within
a database. To give an example:

Public Const Email_StencilOrderer = "CA" 'Joe Bloggs

Then later on when an action is taken I will call this like so:

Call Email.SendMessage(GetEmail(Email_StencilOrderer), "Please order
stencil number " & stencilNumber & ".", "xxxx," & vbCrLf & vbCrLf &
"Please order stencil number " & stencilNumber & " (" & customer & " -
" & product & ")! The data is found in \xxxx\" & stencilNumber & " and
you can find other information (how the board is panelised, etc) using
the xxxxxxx' icon on your desktop." & vbCrLf & vbCrLf & "Ta!", False)

The problem is that people could well be changing jobs quite soon and I
wanted an easier way of updating the list of people who do various
tasks.

I'm thinking (sadly) that im going to have to create a table and have
everything in there which is going to mean a lot of re-coding.

I've never heard of a form updating code, but thought I'd ask anyway..

Ta,

Chris.

Storing it in a table is definitely the way to go, but your re-coding could
be easier than you think. At its easiest, you simply create a function
GetStencilOrderer() to replace your public constant which could simply rely
on the DLOOKUP function. Then do a find and replace through your whole
code.
However, once you have a few of these, it would be a pain to ember all the
function names, so you could make use of enumeration variables e.g.

Public Enum MySetting

SET_STENCIL_ORDERER
SET_EMAIL_MESSAGE
SET_DATA_PATH

End Enum

You can then write a function like

Public Function GetMySetting(S As MySetting)

The function gets its value from a table with an ID column which matches the
enumeration variable - e.g. SET_STENCIL_ORDERER goes to the row with an ID
of zero, SET_EMAIL_MESSAGE goes to the row with an ID of 1, etc.
Does that make sense?
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.