473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Updating Code From a Form

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
1 2270

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
10
by: sqlboy2000 | last post by:
Hello all, I have something very simple going on here and I'm scratching my head as to what the problem is. There are 4 items in my project, 2 webforms, a user control, and a module: ...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
5
by: Mark R. Dawson | last post by:
Hi all, I may be missing something with how databinding works but I have bound a datasource to a control and everything is great, the control updates to reflect the state of my datasource when I...
0
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
4
by: directory | last post by:
hey guys, I've got a weird one for ya....i have a form which takes user input in the form of textbox's etc. It then grabs some details from a file and updates some of the labels with some info...
3
by: Spoogledrummer | last post by:
Hi it's me again, still working on the sam 5 minute problem so feeling kind of thick now. I've dumped the idea of using a textarea for now and am using a textbox instead but am struggling when it...
4
by: AlexNunley | last post by:
I've adopted a moderately sized (65k records) active use database (Access 2000, Windows XP). One of the most commonly used forms is whats called the RMA generation field, used to add claim...
0
by: BizWeb | last post by:
Hi, i am new to ASP.NET. I have write a very simple code to try the updating of the GridView but it is not updating the data. Below is the simple code that i have use. <%@ Page Language="vb"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.