Re: coding a command button to change properties on another form
- From: Alylia <Alylia@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 9 Jan 2007 08:05:00 -0800
Thanks for your response but as I had mentioned I had indicated that a
previous response had been helpful which made me to believe that my question
was no longer going to be worked on.
I sincerely regret this misunderstanding and your advice has been fully noted.
I would be grateful if you would review my codes below and tell me where the
problem is becuase it does not work
Private Sub cmdAgInv_Click()
DoCmd.OpenForm "Travel Agency Invoice Form"
If OpenArgs = "Travel Agency Invoice Form" Then
cmdFPer.Enabled = False
cmdPT8.Enabled = False
cmdSw.Enabled = False
Else
'do nothing
End If
End Sub
"Al Campagna" wrote:
Alylia,.
Please don't ask the same question again while folks are responding to your first post.
It creates duplicate effort, and the continuity of the problem will suffer.
If you must re-ask the same question, it would be good to let those folks helping you
out on the previous post, that you are reposting.
Be patient though, we're all volunteers, and someone who has been helping you may not
always be available consistently.
Your problem can be handled by the OpenArgs argument of the OpenForm method.
DoCmd.OpenForm "frmForm2", , , , , , "ICameFromForm1"
When Form2 Opens, it can use the OpenArgs value to decide which controls to enable or
disable.
If OpenArgs = "ICameFromForm1" Then
'disable your controls
Else
'enable your controls
End If
--
hth
Al Campagna
Candia Computer Consulting
Microsoft Access MVP - Candia, NH USA
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
"Alylia" <Alylia@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A2197A9A-C97A-4076-BC00-7074EF5F17FE@xxxxxxxxxxxxxxxx
This question had been posted yesterday but I had in error indicated that an
early response was helpful.
I need help on how to code on one form to chane the property settings of
controls on another form.
I have one command button which has a macro that I use to open the other
form without closing the initial. On this command button that has a macro, I
want to write a code so that when the other form is opened certain command
buttons on it will be disabled.
The form is opened from at least two other forms. What I want is basically
that when I open from this particular form certain command button should be
disabled but when it opened from the other forms these buttons should be
enabled (which is now the case).
There no condition to change the command button properties on the form to be
opened from the intial form. I would like to this form to be opened to view
records only and therefore all command buttons should be disabled except the
one that should close the form.
- Follow-Ups:
- Re: coding a command button to change properties on another form
- From: Al Campagna
- Re: coding a command button to change properties on another form
- References:
- Re: coding a command button to change properties on another form
- From: Al Campagna
- Re: coding a command button to change properties on another form
- Prev by Date: Exporting data from table with memo field
- Next by Date: ListCount behaving not as expected.
- Previous by thread: Re: coding a command button to change properties on another form
- Next by thread: Re: coding a command button to change properties on another form
- Index(es):