473,503 Members | 1,726 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 1140
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
2464
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...
11
18803
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...
10
7379
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...
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...
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...
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.. ...
0
1289
by: visweswaran2830 | last post by:
Hi, I want to Create Logon script using vbscript to install software in remote system.
15
4399
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...
3
7851
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...
4
5166
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...
0
7203
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
7087
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
7281
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,...
1
6993
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
5579
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,...
1
5014
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...
0
4675
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...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
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...

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.