473,473 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code Check Please

67 New Member
Hi all

I am having trouble getting some code working. Would someone please check the following code and tell me why it doesn't work. If additional info is required please ask. Thanks.


Private Sub Cost_Change()
If Me.DateOfSale >= 30 / 11 / 2008 Then
Me.Vat15.Visible = True
Me.Total15.Visible = True
Me.Vat.Visible = False
Me.TotalCost.Visible = False
Else
If Me.DateOfSale <= 1 / 12 / 2008 Then
Me.Vat15.Visible = False
Me.Total15.Visible = False
Me.Vat.Visible = True
Me.TotalCost.Visible = True
End If
End If

End Sub
Dec 3 '08 #1
2 1109
FishVal
2,653 Recognized Expert Specialist
Hello, Wayneyh.

What you are trying to implement seems to me very complicated, not flexible and not robust approach.
Do you want to add a control to form and section to code each time VAT changes? Also, this approach will make you add conditions to queries totalling records and so on so on.

Why not to make a table, let us say tblVAT with the following structure:

keyVATID Autonumber(Long), PK
dteStart Date/Time
dteEnd Date/Time
sglVAT Number/Single

Further you can join it with your table in the following manner:

Expand|Select|Wrap|Line Numbers
  1. SELECT [YourTable].Cost + [YourTable].Cost*(1+[tblVAT].[sglVAT]/100) AS CostAndVAT FROM [YourTable] INNER JOIN [tblVAT] ON [YourTable].dteSale<=[tblVAT].dteEnd AND [YourTable].dteSale>=[tblVAT].dteEnd;
  2.  
Regards,
Fish
Dec 3 '08 #2
Wayneyh
67 New Member
Thanks fish, i will try that.

Regards
Dec 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
by: LordBlue | last post by:
Hi, please forgive me if i'm sending this post in the wrong place, and please don't tell me to post it in another group, because if i found a better one i'd have already done it. I'm writing a...
3
by: cisco | last post by:
Let's say i have something, that will eat up a lot of cpu cycles, that i want to run for the whole webpage( asp.net application and all subfolders underneath). What's the best way to accomplish...
1
by: =?Utf-8?B?Wmlub24=?= | last post by:
Hello I have an ASP.NET 2 intranet application written in C#. I use Active Directory authentication and parts of the application uses AJAX. From time to time (about once every 200-300 accesses...
7
by: robin1983 | last post by:
Hi, good morning everyone, i have a file called attendence.php The problem is that some part of code is executing properly and half of the code is not and i dont get any warning or error message. For...
29
by: Virtual_X | last post by:
As in IEEE754 double consist of sign bit 11 bits for exponent 52 bits for fraction i write this code to print double parts as it explained in ieee754 i want to know if the code contain any...
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
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...
1
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.