open form with specific record shown

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a database where users must enter a password to 'sign' that they have
taken out a particular item. I am now trying to get it so that it's possible
for a user to change their password. The user's name is selected from a combo
box (column 0). They must then type their old password into a text box which
compares it to their current password. If correct, a new form opens where
they must type in their new password and repeat it. If matching, this changes
the password.

The problem is that it always changes the first record's password, rather
than the specified user. How can I get it to go straight to the record of the
selected person. The simpler the answer the better.
Thanks,
Adrian
 
Use the where condition in the Open form command line

If you open the form by a user name
docmd.OpenForm "FormName",,,"UserNameFieldName = '" & CurrentUserName & "'"
=============================================
If you open the form by a user id that is number type
docmd.OpenForm "FormName",,,"UserNameFieldName = " & CurrentUserId
 
thanks, that probably would work but users do not need to log in as such.
instead, when they want to take out an item, they must enter their password
when their name is selected to confirm that they agree to certain conditions.
this is the password that needs to be changed and it is kept in a users table
along with the names and other info. the problem is getting the name selected
in the combo box to be the record opened in the second change password form
adrian
 
Then change the CurrentUserName to Me.ComboFieldName
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top