By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,042 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,042 IT Pros & Developers. It's quick & easy.

Update new Password to table via Forms & Macro

P: n/a
hi y'all!

i pretty much wanted to do a custom form where users can change their
password to the database as they like..

the problem i encountered is that it seems that when a valid user enter
their new password, the new password is not reflected in the respective
tables and after clicking the cmdChangePW, nothing happen despite me
puttin a msgbox "Password changed" after running the SQL.

I know access has a userlevel security, and i can't use it. Project
manager was afraid it would not be compatible with other computer
ourside the organisation..

Can anyone help me with this? Still quite unfamiliar with access,
thanxs lotsa!

Cheers!

i included the following:
txtusername
txtOldPw
txtNewPw
txtconfirmPw

and a command button, cmdChangePW
on the click event of the command button, i ran a macro which did the
following:
1) check any of the textboxes are null
2) check passwords are correct
3) run 3 SQLs
SQLs are like this [Do note that there are 3 tables containing 3
different userIDs and passwords to provide for different permissions
for different users]
UPDATE tblPasswordReceivi
SET tblPasswordReceivi.Password = '" & txtConfirmPW & "' WHERE
tblPasswordReceivi.UserID ='" & txtusername & "'";
UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password='" & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";
UPDATE tblPasswordMgmt
SET tblPasswordMgmt.Password='" & txtConfirmPW & "' WHERE
tblPasswordMgmt.UserID ='" & txtusername & "'";

Jan 16 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Pretty sure that your SQL statements need "Update [myTableName]" added at
the beginning of each to actually change the value of a field in an existing
record.
-Ed

"Darren" <Ye********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
hi y'all!

i pretty much wanted to do a custom form where users can change their
password to the database as they like..

the problem i encountered is that it seems that when a valid user enter
their new password, the new password is not reflected in the respective
tables and after clicking the cmdChangePW, nothing happen despite me
puttin a msgbox "Password changed" after running the SQL.

I know access has a userlevel security, and i can't use it. Project
manager was afraid it would not be compatible with other computer
ourside the organisation..

Can anyone help me with this? Still quite unfamiliar with access,
thanxs lotsa!

Cheers!

i included the following:
txtusername
txtOldPw
txtNewPw
txtconfirmPw

and a command button, cmdChangePW
on the click event of the command button, i ran a macro which did the
following:
1) check any of the textboxes are null
2) check passwords are correct
3) run 3 SQLs
SQLs are like this [Do note that there are 3 tables containing 3
different userIDs and passwords to provide for different permissions
for different users]
UPDATE tblPasswordReceivi
SET tblPasswordReceivi.Password = '" & txtConfirmPW & "' WHERE
tblPasswordReceivi.UserID ='" & txtusername & "'";
UPDATE tblPasswordPurchase
SET tblPasswordPurchase.Password='" & txtConfirmPW & "' WHERE
tblPasswordPurchase.UserID ='" & txtusername & "'";
UPDATE tblPasswordMgmt
SET tblPasswordMgmt.Password='" & txtConfirmPW & "' WHERE
tblPasswordMgmt.UserID ='" & txtusername & "'";

Jan 16 '06 #2

P: n/a
i dun get what ya mean..

One SQL is like this:

UPDATE [tblPasswordPurchase] SET [tblPasswordPurchase]![Password] = '"
& [Forms]![frmUpdatePW]![txtConfirmPW] & "'
WHERE ((([tblPasswordPurchase]![UserID])='" &
[Forms]![frmUpdatePW]![txtusername] & "'));

is anything wrong?

Jan 17 '06 #3

P: n/a
Oops, that wasn't visible in the copy that I read. Some of my apps do
something similar to yours, but I use a local table on each front-end to
store user name & password, then on start-up, just a simple log-on form that
checks the entry against those values.
-Ed

"Darren" <Ye********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
i dun get what ya mean..

One SQL is like this:

UPDATE [tblPasswordPurchase] SET [tblPasswordPurchase]![Password] = '"
& [Forms]![frmUpdatePW]![txtConfirmPW] & "'
WHERE ((([tblPasswordPurchase]![UserID])='" &
[Forms]![frmUpdatePW]![txtusername] & "'));

is anything wrong?

Jan 17 '06 #4

P: n/a
yep..i created three local tables and a simple log-on form and aft
that, i was wonderin how to create something to allow users to change
password anytime w/o administrator doin that..,

i created another form (details in my first post), and the problem i
encounter is that the update query seems not to be able to "pluck" out
the field (txtConfirmPW) from the form to update to the respective
tables.

It just doesn't work and i dunno why..can ya help me? Would it be
better if i send ya the database?

thanxs for that though..appreciate it!

Jan 18 '06 #5

P: n/a
Just guessing here, but are you sure that your form is still open when those
controls are trying to be read for the update query. Also, why use an
update at all. A bound form will simply overwrite the existing password
record with the new one. Set the form properties to: Edit=YESY, Add=NO,
Data Entry=NO.
-Ed

"Darren" <Ye********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
yep..i created three local tables and a simple log-on form and aft
that, i was wonderin how to create something to allow users to change
password anytime w/o administrator doin that..,

i created another form (details in my first post), and the problem i
encounter is that the update query seems not to be able to "pluck" out
the field (txtConfirmPW) from the form to update to the respective
tables.

It just doesn't work and i dunno why..can ya help me? Would it be
better if i send ya the database?

thanxs for that though..appreciate it!

Jan 18 '06 #6

P: n/a
i'm sorry i dun get what ya mean

if i were to do an update with a bound form, it would not have verified
whether the userID and password was valid..

I'm sorry coz i'm quite a beginner at dis...

Jan 24 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.