Link to home
Start Free TrialLog in
Avatar of thinker388
thinker388

asked on

Changing tag property

how can i change the tag property at a click of a button? im password protecting the form thru the tag property..now ive setup another form to change the passwrod(tag)..my code in that other form is:

On Error GoTo Err_Command9_Click
   
        Dim stDocName As String
        Dim stLinkCriteria As String

        stDocName = "frmAdmin"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
       
        [Forms]![frmadmin].Tag = txtNewPass

after i click the button, i dont get any error msg and the tag property doesnt change either..whats going wrong?
Avatar of rockiroads
rockiroads
Flag of United States of America image

did u try changing the tag property before u open the form?
SOLUTION
Avatar of knollbert
knollbert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
na, u cant unless u first open it in design mode

the alternative is to create a public procedure in that form, then call that passing in the password, and called code does the rest or have a hidden textbox
Avatar of thinker388
thinker388

ASKER

i did this:

If txtNewPass = txtCNewPass Then
[Forms]![frmadmin].Tag = txtNewPass
    On Error GoTo Err_Command9_Click
   
        Dim stDocName As String
        Dim stLinkCriteria As String

        stDocName = "frmAdmin"
        DoCmd.OpenForm stDocName, , , stLinkCriteria

still doesnt work
It worked for me
Note
[Forms]![frmadmin].form.Tag = txtNewPass
 NOT
[Forms]![frmadmin].Tag = txtNewPass
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dont think you can at run time permenatly change the tag property of a form that is what you are trying to do yes?

I would create a hidden table and store the password in that.  I usually use a table called tblpref and store the password in that.  I use 2 field key and string I set the key to password and the string to the password.  then I do a dlookup to test if the password is correct and use an rs or a query to change it.

HTH

Jag5x5
knollbert...that didnt work...

rockiroads...can u expand a bit upon the alternative?


create a public procedure in which form? the one with the txtnewpass or the one whose tag property i wanna change..

and where should i call it? and should it have the exact code as in my existing clicck procedure?

and how can i use the hidden textbox?

Thanks...
knoll...ive tried both ways..no luck

walter..im sure...cuz i have two fields..passwd and conf passwd..n i only let the procedure run if they r equal...ive tried typing in diff values for the two passwd boxes..and it didnt run as planned...


jag..yes thats what im trying to do
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok i just talked with the person  for whom I'm doing this project for, and he said that he's just going to change the tag by going to design view himself. :)

Thanks a lot for the replies...I'll split up the points.