473,406 Members | 2,217 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,406 software developers and data experts.

uodate simplified

I want to build a function that sets chosen fields to 0.
I want to simplify my function since i have to repeat and and the same line
code.
I am doing now the following
Public function ClearFields()
' set the field Field2 to 0
Dim sqlField2 as string
sqlField2 = " Update products SET Field2 = 0"
CurrentDb.Execute SqlField2
' set the field Field4 to 0
Dim sqlField5 as string
sqlField5 = " Update products SET Field5 = 0"
CurrentDb.Execute SqlField5

etc etc I have 4 more fields to set to 0"

Is there any way to simplify my code, put the fields into brackets and just
contain the function into one or two lines ?
Nov 12 '05 #1
1 1175
Primerov wrote:
I want to build a function that sets chosen fields to 0.
I want to simplify my function since i have to repeat and and the same line
code.
I am doing now the following
Public function ClearFields()
' set the field Field2 to 0
Dim sqlField2 as string
sqlField2 = " Update products SET Field2 = 0"
CurrentDb.Execute SqlField2
' set the field Field4 to 0
Dim sqlField5 as string
sqlField5 = " Update products SET Field5 = 0"
CurrentDb.Execute SqlField5

etc etc I have 4 more fields to set to 0"

Is there any way to simplify my code, put the fields into brackets and just
contain the function into one or two lines ?


sqlField2 = " Update products SET Field2 = 0, Field3 = 0, Field4 = 0,
Field5 = 0,...Field100 = 0"

Nov 12 '05 #2

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

Similar topics

1
by: David A. Caballero J. | last post by:
I have a 3 layer system, SQL Server 2000 database, COM+ dll's (VC++ 6) and ASP frontend, this system has been in production for quite some time using english, spanish and portuguese versions. Now...
3
by: Stephan Kurpjuweit | last post by:
Hi! I am looking for a simplified Docbook XML schema. As far as I know, "Simplified Docbook" only exists as DTD, right? Could you please send me pointers or ideas that might be useful for me? ...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
0
by: Grey | last post by:
how to display the LABEL control with simplified chinese wording in ASP.NET
0
by: | last post by:
ASP.NET 2.0 simplifies binding datasources to controls like the repeater. These new methods allow nearly code-less mechanisms to dump data to a page. I like this new feature a whole lot. HTML...
3
by: James Allen Bressem | last post by:
If you aare going to change the entire Basic language in a new distribution the least Microsoft coulds have done for VBers is give us a new simplified syntax. I have seen many cases in VB.net where...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
1
by: Aprile | last post by:
Hello, everyone. I would like to ask something about searching Chinese simplified characters from the database. Every time I searched, it won't display data, but if I searched without a condition it...
0
by: scriptmann | last post by:
Hi, I'm trying to use os.listdir() to list directories with simplified chinese filenames. However, while I can see the filenames correctly in windows explorer, I am getting ? in the filename...
13
by: fulio pen | last post by:
I have following page: http://www.pinyinology.com/test/testGet.html Part of the code is: javascript: document.getElementById("moon1").innerHTML ="moon";...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.