Hey all, hopefully someone can guide me in the right direction. So in this table, under Operations there are 5 selections you can select. Whichever option is selected along with the Total, I need it to go to the appropriate field. So far I have tried and did not work:
IIf([Operation]="S1","Total","0")
I attached images to help. 5 1854
jxdq,
Welcome to Bytes!
Are you working with your table in Datasheet view? In order for such calculations to occur, you need to use a Form.
Hope that hepps!
Thank you for responding sir! I do have a form.
What do I add inside of design view of "Operations" to make it go to the proper field after being selected and hitting submit? http://imgur.com/a/fHLqP
jxdq,
It depends on the names of the controls on your Form, but generically: - Private Sub cboOperation_AfterUpdate()
-
On Error GoTo EH
-
-
Me.txtS1 = 0
-
Me.txtS2 = 0
-
Me.txtS3 = 0
-
-
Select Case cboOperation
-
Case "S1"
-
Me.txtS1 = Me.txtTotal
-
Case "S2"
-
Me.txtS2 = Me.txtTotal
-
Case "S3"
-
Me.txtS3 = Me.txtTotal
-
End Select
-
-
Exit Sub
-
EH:
-
MsgBox "There was an Error!"
-
Exit Sub
-
End Sub
There is a slight challenge with this particular arrangement, however. By placing the value of Total into S1..S3, you are introducing redundant information into your table, which is generally a no-no. If you were to generate a Report based on the data in your table, you can accomplish the same results through a query. Generally speaking, you should not maintain any calculated values as permanent values in your Table, unless you don't actually save the values from which the total is calculated.
I hope this makes sense.
Let me know if this hepps.
jxdq,
I will give my recommendation and then give the theoretical and practical reasons for this. Other mods and experts are free to chime in, but I think I am on pretty solid ground.
First, if the Total field is only going to go into one of your three other fields, I would have a Total field with the amount and an Operations Field, with the type of operation indicated.
Second, the theory. If you have three separate fields for S1, S2 and S3, then, since the data is only ever stored in one of these fields, you now no longer have redundant data, but empty space. Again, not recommended. By keeping the Total field and Operation fields, you now have 1) no redundant data, and 2) no empty space.
Third, the practical. Right now, you only have three operations: S1, S2 and S3, correct? What happens when you add an operation (this also falls into the realm of theory). What if you had 20 types of operations? This would make your table very wide for the different operation types having a separate field -- AND 95% of those fields would be empty all the time. Not to mention that every time you added another operation type, you would have to restructure your data tables. My recommendation precludes all the restructure and allows for future expansion based upon your needs and still adheres to sound DB practices.
Hope this hepps!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chuck Grimsby |
last post by:
(Repost, due to lack of submissions...)
The Microsoft Access Product Group (the people who build Microsoft
Access) want your help!
One of the main things we're working on for the near future...
|
by: Larry__Weiss |
last post by:
What kind of licensing is needed to be able to use the Microsoft Access product
and distribute the applications? In other words, what version of Microsoft Access
does a developer need to buy in...
|
by: Null Reference |
last post by:
Anybody here who can explain or point me to a link ?
I wish to create a blank MS Access DB file programmatically
using C# .
Thanks, nfs
|
by: Pam Ammond |
last post by:
I need to use Microsoft Access Automation within a Visual Studio 2003 program
written in C# for Windows Forms. When a button is clicked in my VS.NET
program, I want it to run a Microsoft Access...
|
by: bbdobuddy |
last post by:
Hi,
How do I open a Microsoft Access 2003 form from Visual Basic.net
Thanks in advance
bbdobuddy
|
by: somersbar |
last post by:
hey,
ive been trying to set up a web form in visual basic.net that can
access a microsoft access database. i need to use odbc also. i can get
it working using a windows form but not a web form....
|
by: somersbar |
last post by:
hello all,
im trying to connect to a microsoft access database from an ASP.NET web
form.
i keep getting the following error though:
ERROR Could not use
'(unknown)'; file already in use....
|
by: bazzer |
last post by:
hey,
i am using visual basic.net 2003 and have an ASP.NET webform
application thats accessing a microsoft access 2003 database. i kept
getting the following error when i tried to run it:
ERROR ...
|
by: bazzer |
last post by:
hey,
im trying to access a microsoft access database from an ASP.NET web
application in visual basic 2003.NET. i get the following error when i
try running it:
Server Error in...
|
by: ipellew |
last post by:
Hi;
I 'e been developing a little application based on MS Access (I am
usually in Informix) and have to say the Web is full of sites that
offer little in the way of help.
I have to say that...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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...
| |