473,657 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visual basic within Access If...Then

I have a form that's based on a query. I'm trying to make the form
only accept hours worked if there is a pay rate already entered in
another form. If not the form will return a message box notifiying the
user that there is no corresponding pay rate for the hours entered,
then return the fields to null values. The problem is that my code
only works for the A rate and not for the C rate. I think my structure
or my thinking about how to do this wrong. Any help you can provide is
appreciated. Below is the code that I have so far:

Private Sub Form_AfterUpdat e()
If ACheck = "bad" Then
MsgBox "You must first enter an A rate in the employee's edit form
before entering hours worked"
Me.asmonday = Null
Me.aomonday = Null
Me.admonday = Null
Me.astuesday = Null
Me.aotuesday = Null
Me.adtuesday = Null
Me.aswednesday = Null
Me.aowednesday = Null
Me.adwednesday = Null
Me.asthursday = Null
Me.aothursday = Null
Me.adthursday = Null
Me.asfriday = Null
Me.aofriday = Null
Me.adfriday = Null
Me.assaturday = Null
Me.aosaturday = Null
Me.adsaturday = Null
Me.assunday = Null
Me.aosunday = Null
Me.adsunday = Null
Me.asx = Null
Me.aox = Null
Me.adx = Null
End If
If CCheck = "bad" Then
MsgBox "You must first enter a C rate in the employee's edit form
before entering hours worked"
Me.csmonday = Null
Me.comonday = Null
Me.cdmonday = Null
Me.cstuesday = Null
Me.cotuesday = Null
Me.cdtuesday = Null
Me.cswednesday = Null
Me.cowednesday = Null
Me.cdwednesday = Null
Me.csthursday = Null
Me.cothursday = Null
Me.cdthursday = Null
Me.csfriday = Null
Me.cofriday = Null
Me.cdfriday = Null
Me.cssaturday = Null
Me.cosaturday = Null
Me.cdsaturday = Null
Me.cssunday = Null
Me.cosunday = Null
Me.cdsunday = Null
Me.csx = Null
Me.cox = Null
Me.cdx = Null
End If
End Sub

Oct 5 '06 #1
0 1420

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

Similar topics

7
9277
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. # No warranty express or implied for the accuracy, fitness to purpose
8
5670
by: delete table with Visual Basic 6 | last post by:
Dear developer, I have an error message when I try to delete or drop Microsoft Access XP table with ADOX in Visual Basic 6. I use the ADOX.Catalog and ADOX.table to create and delete or drop table within Visual Basic program. If anybody knows how to solve the problem, please give me the solution. I would like to thank you for your attention and response. Best regard, Sanad
2
12817
by: Ermi | last post by:
Hi, i have this problem.... From a visual basic application I must replace the value contained in a column with another one....for example Field1 ------ Alfa Beta Gamma
5
524
by: john | last post by:
I searched http://www.sellsbrothers.com. and could not find anything about this subject. How do I make C# User Controls Visible to Visual Basic 6.0 Applications? Thanks, John
5
3794
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems; a.. Under the "Connection" tab, under "1. Select or enter a server name:" when I either select the drop down box or click the refresh button I get an error dialog saying "Error enumerating data servers. Enumerator reports Unspecified error'". The...
10
8194
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied everything I can find on COM Interop and .NET. I've also tried many of the 'Walkthroughs' on the MSDN site relating to COM add-ins, .NET and Office XP but am unable to get even these working in Excel 2002 or Word 2002. I've installed the Office XP...
6
11597
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual Basic.Net?" With all the field properties, such as, field length and type. I'm not sure if this is a stupid quesiton or If I am just over looking something, but I have not found solid information on the internet about this topic. Any useful...
4
1723
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, - Programming Visual Basic by Balena (MS Press) and - Visual Basic 2005 by Willis (WROX), but they don't go into the forms design aspects and describing the various controls at all. What bookscan I get that will cover that?
2
2079
by: CAM | last post by:
Hello, I am wondering if someone can give me some pointers. Currently I am using Access 2002 I developed an inventory tracking database, which this database is used in California and in Florida. Unfortunaley Access is not very good as an enterprise wide database, accessing the data from one side of the United States to the other its so slow. About 5 years ago I developed a database using Visual Basic 6 as the front end and Crystal...
97
5482
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in the first place. Anyone else heard about this development? The Master
0
8394
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
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 we have to send another system

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.