473,414 Members | 1,729 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,414 software developers and data experts.

Global Function Guidance

I need some assistance or advise in composing code for a global
function module or a related one for populating values in text boxes
on reports and forms with a name, actually several different names.
There are over 50 fields in the database requiring name updates and I
need to do this several times. And I don't want to use a table/form to
perform this task.

Here is a bit more information. Yes, I have done the changing of the
values in the text boxes by using a small table and a related form
(optional). An update query would work as well, but here is the spin
on the matter. Since the database has/is/will be compiled as a .mde,
there is obviously no access to the code in the modules, but the
tables and queries are another matter. I do not want to assume the
risk of others accessing or changing the values in the text boxes, so
the logical approach is to use VBA code to achieve it. Anyone's
assistance will be appreciated.

Thanks, Dalan
Nov 12 '05 #1
3 8067
"Dalan" <ot***@safe-mail.net> wrote in message
news:50**************************@posting.google.c om...
I need some assistance or advise in composing code for a global
function module or a related one for populating values in text boxes
on reports and forms with a name, actually several different names.
There are over 50 fields in the database requiring name updates and I
need to do this several times. And I don't want to use a table/form to
perform this task.

Here is a bit more information. Yes, I have done the changing of the
values in the text boxes by using a small table and a related form
(optional). An update query would work as well, but here is the spin
on the matter. Since the database has/is/will be compiled as a .mde,
there is obviously no access to the code in the modules, but the
tables and queries are another matter. I do not want to assume the
risk of others accessing or changing the values in the text boxes, so
the logical approach is to use VBA code to achieve it. Anyone's
assistance will be appreciated.

Thanks, Dalan

One option is to secure the database so you don't allow users to modify the
relavant table - however if you have not yet implememted user-level security
that might be a bit too much work.
If you want to fix the values in your code, then you could also do that.
For example, as part of a project a customer needed a small selection of
labels to choose from. For various reasons I did not want to add new
tables, so these values were hard-coded and displayed to the user in a
combobox:

strList = strList & """Label"";""Across"";""Down"";""Label size"";"
strList = strList & """J8163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7160"";3;7;""6.35cm x 3.81cm"";"
strList = strList & """L7163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7173"";2;5;""9.90cm x 5.70cm"";"

Me.cboLabelSize.RowSource = strList
Perhaps if I understood the following: There are over 50 fields in the database requiring
name updates and I need to do this several times.

Then I could give some more specific advice.

Fletcher

Nov 12 '05 #2
"Fletcher Arnold" <fl****@home.com> wrote in message news:<bl**********@titan.btinternet.com>...
"Dalan" <ot***@safe-mail.net> wrote in message
news:50**************************@posting.google.c om...
I need some assistance or advise in composing code for a global
function module or a related one for populating values in text boxes
on reports and forms with a name, actually several different names.
There are over 50 fields in the database requiring name updates and I
need to do this several times. And I don't want to use a table/form to
perform this task.

Here is a bit more information. Yes, I have done the changing of the
values in the text boxes by using a small table and a related form
(optional). An update query would work as well, but here is the spin
on the matter. Since the database has/is/will be compiled as a .mde,
there is obviously no access to the code in the modules, but the
tables and queries are another matter. I do not want to assume the
risk of others accessing or changing the values in the text boxes, so
the logical approach is to use VBA code to achieve it. Anyone's
assistance will be appreciated.

Thanks, Dalan

One option is to secure the database so you don't allow users to modify the
relavant table - however if you have not yet implememted user-level security
that might be a bit too much work.
If you want to fix the values in your code, then you could also do that.
For example, as part of a project a customer needed a small selection of
labels to choose from. For various reasons I did not want to add new
tables, so these values were hard-coded and displayed to the user in a
combobox:

strList = strList & """Label"";""Across"";""Down"";""Label size"";"
strList = strList & """J8163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7160"";3;7;""6.35cm x 3.81cm"";"
strList = strList & """L7163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7173"";2;5;""9.90cm x 5.70cm"";"

Me.cboLabelSize.RowSource = strList
Perhaps if I understood the following:
There are over 50 fields in the database requiring
name updates and I need to do this several times.

Then I could give some more specific advice.

Fletcher


Thanks for the reply Fletcher. I assumed that there might be a way to
structure some code on a global basis for doing this. In lieu of that
approach, perhaps constructing an update query could be an
alternative. Any suggestions in that arena? The database will
eventually be compiled in runtime, so that should further limit a
user's access. It's a security measure to ensure specific usage by an
entity. Thanks.
Nov 12 '05 #3

"Dalan" <ot***@safe-mail.net> wrote in message
news:50**************************@posting.google.c om...
"Fletcher Arnold" <fl****@home.com> wrote in message

news:<bl**********@titan.btinternet.com>...
"Dalan" <ot***@safe-mail.net> wrote in message
news:50**************************@posting.google.c om...
I need some assistance or advise in composing code for a global
function module or a related one for populating values in text boxes
on reports and forms with a name, actually several different names.
There are over 50 fields in the database requiring name updates and I
need to do this several times. And I don't want to use a table/form to
perform this task.

Here is a bit more information. Yes, I have done the changing of the
values in the text boxes by using a small table and a related form
(optional). An update query would work as well, but here is the spin
on the matter. Since the database has/is/will be compiled as a .mde,
there is obviously no access to the code in the modules, but the
tables and queries are another matter. I do not want to assume the
risk of others accessing or changing the values in the text boxes, so
the logical approach is to use VBA code to achieve it. Anyone's
assistance will be appreciated.

Thanks, Dalan

One option is to secure the database so you don't allow users to modify the relavant table - however if you have not yet implememted user-level security that might be a bit too much work.
If you want to fix the values in your code, then you could also do that.
For example, as part of a project a customer needed a small selection of
labels to choose from. For various reasons I did not want to add new
tables, so these values were hard-coded and displayed to the user in a
combobox:

strList = strList & """Label"";""Across"";""Down"";""Label size"";"
strList = strList & """J8163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7160"";3;7;""6.35cm x 3.81cm"";"
strList = strList & """L7163"";2;7;""9.90cm x 3.81cm"";"
strList = strList & """L7173"";2;5;""9.90cm x 5.70cm"";"

Me.cboLabelSize.RowSource = strList
Perhaps if I understood the following:
There are over 50 fields in the database requiring
name updates and I need to do this several times.

Then I could give some more specific advice.

Fletcher


Thanks for the reply Fletcher. I assumed that there might be a way to
structure some code on a global basis for doing this. In lieu of that
approach, perhaps constructing an update query could be an
alternative. Any suggestions in that arena? The database will
eventually be compiled in runtime, so that should further limit a
user's access. It's a security measure to ensure specific usage by an
entity. Thanks.

Hi Dalan
I still can't quite see exactly what you are trying to do. Are you talking
about values which will remain constant when the application is run? For
example, you sell the application to a company and want to hard-code the
company name and address so this prints out on forms and reports.
If this is the case, then you could simply create a new module and place the
constants in there, eg:
Public Const g_strComName As String = "Whatever Industries Ltd"
Public Const g_strComAddress As String = "7 Station Road"
Then in the report's open event you could set the labels' captions, eg:
Me.lblComName.Caption = g_strComName

Alternatively have a public function:

Public Function GetConst(strConst As String) As String

Dim strReturn As String

Select Case strConst
Case "ComName": strReturn = "Whatever Industries Ltd"
Case "ComAddress": strReturn = "7 Station Road"
Case Else: strReturn = "Unknown Constant"
End Select

GetConst = strReturn

End Function

So you can set the controlsource of a textbox to be
=GetConst("ComName")
Is this the sort of thing? Or should these be gloabl variables which change
their values a number of times while the apppliaction is running? These
will need to be treated with more caution.
Fletcher


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
8
by: jose luis fernandez diaz | last post by:
Hi, I am reading Stroustrup's book 'C++ Programming Language'. In the 10.4.9 section (Nonlocal Store) he says: "A variable defined outside any function (that is global, namespace, and class...
2
by: Thomas Matthews | last post by:
Hi, I'm getting linking errors when I declare a variable in the global scope, but not inside a function. The declarations are the same (only the names have been changed...). class Book {...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
2
by: Dan Bass | last post by:
Environment C#, Asp.Net 2.0, Windows 2000 Server Problem I'm trying to enumerate all the names in the global contacts on the exchange server using CDO / ADO / (whatever I can). In writing an...
3
by: Travis | last post by:
Hi , I created a class call GlobalVar in global module public class GlobalVar { public string str1 public string str2 }
4
by: Phil Latio | last post by:
I'm kind of looking for some guidance in respect of this obstacle I'm up against - please let me expand; I have an option group with three options (AND, OR, & NONE) and a text box which will...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.