473,537 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want to create a logon form in Access with code of VB

2 New Member
I am trying to write this code by do not work?

dim name1 as string
dim pass1 as string

if(me.name="") then
msgbox "Please enter your Name",,"Warning"
else
name1=me.name

else if(name.pass="") then
msgbox"Please enter your Pass",,"Warning"
else
pass1=me.pass
else if(name="abc" and pass="123") then
docmd.openform "employ"
else
msgbox "name and Password does not match"
end if
Mar 8 '11 #1
1 1149
James Bowyer
94 New Member
Try this

Expand|Select|Wrap|Line Numbers
  1. dim name1 as string
  2. dim pass1 as string
  3.  
  4. if(me.name="") then
  5. msgbox "Please enter your Name",,"Warning"
  6. me.name.setfocus
  7. exit sub
  8. else
  9. name1=me.name
  10. End If
  11.  
  12. if(me.pass="") then
  13. msgbox"Please enter your Pass",,"Warning"
  14. me.pass.setfocus
  15. exit sub
  16. else
  17. pass1=me.pass
  18. end if
  19.  
  20. if(name="abc" and pass="123") then
  21. docmd.openform "employ"
  22. else
  23. msgbox "name and Password does not match"
  24. end if 
  25.  
Mar 8 '11 #2

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

Similar topics

6
2470
by: skgolden | last post by:
My husband and I own a small temporary labor company and deal with 4 major clients (A,B,C & D), each of which has about 2 dozen units in our tristate area that we deal with (ie, Company A, units a,b,c,d,e etc). We send temps possessing various skills (cashier, cook, hostess, etc) to the individual units as needed. What I'm trying to do is...
11
18809
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion...
10
7391
by: Minh | last post by:
I search in all the Disscussion but can not found. How can I create a MS Access Database file using C# code with a given Table Structure ? For example, I want to create a Access Database File with 2 tables: Student and Department, of course, using C# code, not using MS Access to create manually. In Department table, I will have 3...
3
1322
by: kpuchala | last post by:
Hello I'm beginnig to create my first application in Visual Web Debeloper 2005 Express. I need to create a web site (simple application), which will allow to list objects (records) stored in databese. This is the simple part and I managed to do this. Further I want to bind the list to a form. After klicking an object on the list, the...
5
2583
by: superjacent | last post by:
Hope someone can help. I have a saved parent form containing an unbound sub-form. I set the SourceObject (form) after the Parent Form opens/loads. The sub-form (datasheet view) basically displays the results of a cross-tab query The cross-tab query is created dynamically (in code) as the column headings are subject to change. I...
8
5898
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. So if the user selects 3 months in the criteria form, there will be 3 (month) column headings, if he selects 6 months, the will be 6 headings.
0
1297
by: visweswaran2830 | last post by:
Hi, I want to Create Logon script using vbscript to install software in remote system.
15
4400
by: jt196 | last post by:
I'm trying to create an editable form of fulfilled orders on my system and am running into problems with creating a form based on this query. The field that I need to update (invoice number) is read-only. I DO understand the reasons for this: The query takes information from an orders table and a transactions table which have a one to many...
3
7855
meenesh
by: meenesh | last post by:
related to above question please help me out :-- on the basis of above interact with database i also want some animated output to appear such as "smile should increase if student secure above 90 marks"or if not then "smile should decrease" though i know it all need a huge knowledge of actionscript and asp.net along with c#..... but still...
4
5170
by: Kelly Warden | last post by:
I want to create a form in Access to update my table automatically with the information selected from combo boxes, lists, comments, etc. Also, I want to automate this w/ some VBA or SQL or something in Access. I want to be able to automatically fill out parts of the form based on some other tables containing different data. Basically in the...
0
7362
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...
0
7300
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...
0
7644
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...
0
5826
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5219
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...
0
4846
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...
0
3347
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...
1
1759
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
0
582
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.