Connecting Tech Pros Worldwide Forums | Help | Site Map

Update new Password to table via Forms & Macro

Darren
Guest
 
Posts: n/a
#1: Jan 16 '06
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 & "'";


Ed Robichaud
Guest
 
Posts: n/a
#2: Jan 16 '06

re: Update new Password to table via Forms & Macro


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" <Yeo.darren@gmail.com> wrote in message
news:1137423413.110539.165070@g49g2000cwa.googlegr oups.com...[color=blue]
> 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 & "'";
>[/color]


Darren
Guest
 
Posts: n/a
#3: Jan 17 '06

re: Update new Password to table via Forms & Macro


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?

Ed Robichaud
Guest
 
Posts: n/a
#4: Jan 17 '06

re: Update new Password to table via Forms & Macro


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" <Yeo.darren@gmail.com> wrote in message
news:1137486257.222991.22500@z14g2000cwz.googlegro ups.com...[color=blue]
>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?
>[/color]


Darren
Guest
 
Posts: n/a
#5: Jan 18 '06

re: Update new Password to table via Forms & Macro


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!

Ed Robichaud
Guest
 
Posts: n/a
#6: Jan 18 '06

re: Update new Password to table via Forms & Macro


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" <Yeo.darren@gmail.com> wrote in message
news:1137556675.630926.318820@g43g2000cwa.googlegr oups.com...[color=blue]
> 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!
>[/color]


Darren
Guest
 
Posts: n/a
#7: Jan 24 '06

re: Update new Password to table via Forms & Macro


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...

Closed Thread