473,395 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Form to get data. With a button to save them to a table. Access 2007

Hi guys, I'm new to Access & SQL. Currently using Access 2007. What I have:

1) Table: Employee( empID, empName, email, pwd, ... )
2) Form: - Record source ( SELECT empName, email, pwd FROM Employee )
3) 1 combo box. cmbName. Row Source (SELECT Employee.empName FROM Employee;
4) 2 textboxes . txtEmail and txtPwd
5) Button : - Register (no info) and Close form ( Close form button created with button wizard )

Notes:
email field has (Like "*?@?*.?*") validation
Everything is unbound. I guess.I'm not sure with the term though. Sorry

The user is to select his/her name. Type the email and password and click Register. Then the Register button should copy the data to the table and wont allow duplicate email or duplicate password.

I have no idea on how to do it.It is required to use the register button. I found the DAP articles but it's not supported in Access 2007 anymore and I need to perform this on a form.

What coding / setting i need to put on the Register button? Do I need to leave the validation rule in the table or delete that and make the Register button handle the validation. Please help. Sorry if my explanation is not clear. Questions are welcome. Thanks again
Sep 28 '07 #1
1 4005
nico5038
3,080 Expert 2GB
Hi guys, I'm new to Access & SQL. Currently using Access 2007. What I have:

1) Table: Employee( empID, empName, email, pwd, ... )
2) Form: - Record source ( SELECT empName, email, pwd FROM Employee )
3) 1 combo box. cmbName. Row Source (SELECT Employee.empName FROM Employee;
4) 2 textboxes . txtEmail and txtPwd
5) Button : - Register (no info) and Close form ( Close form button created with button wizard )

Notes:
email field has (Like "*?@?*.?*") validation
Everything is unbound. I guess.I'm not sure with the term though. Sorry

The user is to select his/her name. Type the email and password and click Register. Then the Register button should copy the data to the table and wont allow duplicate email or duplicate password.

I have no idea on how to do it.It is required to use the register button. I found the DAP articles but it's not supported in Access 2007 anymore and I need to perform this on a form.

What coding / setting i need to put on the Register button? Do I need to leave the validation rule in the table or delete that and make the Register button handle the validation. Please help. Sorry if my explanation is not clear. Questions are welcome. Thanks again

In the OnClick event of the combobox you would need this code to check the username to exist:
Expand|Select|Wrap|Line Numbers
  1. IF IsNull(Dlookup("empName","Employee","empName='" & Me.cmbName & "'")) then
  2.    msgbox "Invalid username"
  3.    exit sub
  4. end if
  5.  
The other values can be checked this way too, but for the unique Email address and pwd I would define a unique index on the table, thus preventing them to be entered anyhow.
The duplicate pwd is puzzling me a bit as they should be "secret".

Also the difference between a first time user and one "known" is a bit "odd".
I would expect the emailaddress to be filled for a known user and a double entry of the pwd to make sure it's entered correctly...

Nic;o)
Oct 5 '07 #2

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

Similar topics

1
by: Jason Wood | last post by:
Hi everyone, I've a simple table containing member details. I've written a SELECT to select all the members. I've based the form on this select, using the from wizard. Once built I've...
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
4
by: tarafinlay | last post by:
Hi all, I am new to access and am finding it a bit unintuitive having worked with SQL server in the past... And I am in a bit of a hurry because my employer wants me to crank something out which...
2
by: Matuag | last post by:
Hi All, I want to create following command buttons on a Form which users can edit. Save ( Save Changes made) Cancel ( Undo data changes) Exit ( Close form) I am using Macros for each of...
1
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the...
17
by: DeZZar | last post by:
Hi all, I need to regularly backup my database as an Excel file and have been using the File Export option. Problem is I need anyone using the database to be able to do this easily - nopt...
2
by: Cron | last post by:
Hi I'm trying to make a form that makes it optional for the user to save the inputted data. If the user does not tap the save button before leaving the form, the data is silently discarded. This...
11
by: dizzydangler | last post by:
Hi, all! I'm a new user, looking to get some help on a form problem in MS Access 2007 I haven't been able to crack. I've built a form that prompts users to enter new record data, then click...
1
by: AdamOnAccess | last post by:
I'm in Access 2007. I built a feature that to saves the current list in a sub form to a separate table. It works like this: After entering a list of words in the subform, the user can choose to push...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...
0
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
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,...

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.