Command button in Access

  • Thread starter Thread starter pizzats
  • Start date Start date
P

pizzats

Hi,

I'm trying to get a Command button to work on my
subform. The Command button is "Close Form". I used the
wizard. I see the Command button on the subform in
Design view but not in Form view. I thought I would see
it in Form view and then when I click the Command button
the subform would go away.

Help, Thank you,,,Tim (e-mail address removed)
 
Can you put the command button on the main form and use code to make the
subform visible property to No?
 
-----Original Message-----
Can you put the command button on the main form and use code to make the
subform visible property to No?

--
Duane Hookom
MS Access MVP


"(e-mail address removed)"
message news:[email protected]...

Hi, Duane, Yes, I can put the command button on the main
form and make the subform visible property no. The
Command button works on the main form. The subform
does'nt look right in Form view. Maybe that's part of my
problem.
Any other suggestions? Thanks Tim
 
-----Original Message-----
We don't know what your subform looks like or what you expect it to look
like.

--
Duane Hookom
MS Access MVP


"(e-mail address removed)"
address when a particular client is called up on the main
form. The main form displays the Insurance company name
(for example, HUM for Humana) but does not display the
billing address. This is the job of the subform. I want
to put the Close Command button in the subform to close
the subform). I am trying to prepare myself for my
Practical exam in my Access class Tuesday morning at
Cuyamaca college.

Thanks, Tim
(e-mail address removed)>
 
Perhaps the problem is that the Form in a Subform Control, even when
visible, is not "Open". I think what you want to do, possibly, is to set the
Visible property of the Subform Control to False.

Click event code something like:

Me.Parent!<nameofthesubformcontrol>.Visible = False

But, then, you'll have to reset it to true somehow to get it displayed
again -- it won't automatically reset on the next record.

Larry Linson
Microsoft Access MVP
 
I can't imagine why you would want to "close" a subform. You can either make
it invisible or set the source object of the subform control to Null. I
believe you would have to move the focus off the subform prior to doing
this.

BTW: is there a reason why you are posting this in the report's News Group?
It would be more appropriate to the Forms News Group however many of us
review several news groups.
 
-----Original Message-----
I can't imagine why you would want to "close" a subform. You can either make
it invisible or set the source object of the subform control to Null. I
believe you would have to move the focus off the subform prior to doing
this.

BTW: is there a reason why you are posting this in the report's News Group?
It would be more appropriate to the Forms News Group however many of us
review several news groups.
button "Close Form" on my subform). First, I had to use
the "Open Form" Command button. I associated the Insurance
company information subform to it so that it would open
the Insurance Company subform when the Command button
"Open Form" appeared on the main form-I clicked it. Then
with the subform open I chose view (Design view) and put
the new
Command button "Close Form" on it. It worked like a
champ. Also, when I told you that my subform looked
funny (in properties I had Datasheet view selected
instead of
Single form -Format)Thank you for your help! You got the
wheels in my mind turning. Tim (e-mail address removed)
P.S. Microsoft told me to use Reports&Printing
 
-----Original Message-----
Perhaps the problem is that the Form in a Subform Control, even when
visible, is not "Open". I think what you want to do, possibly, is to set the
Visible property of the Subform Control to False.

Click event code something like:

Me.Parent!<nameofthesubformcontrol>.Visible = False

But, then, you'll have to reset it to true somehow to get it displayed
again -- it won't automatically reset on the next record.

Larry Linson
Microsoft Access MVP
work on my subform. First, I selected the "Open Form"
Command button. I associated that button with the
Insurance company information subform. Then, when I
clicked
the "Open form" button on my main form the subform came
up. Then, I put that subform in Design view and put
the "Close Form"
Command button on it. Bingo, I have a "close form" Command
button on my subform that worked! Your thoughts were
like oiling the gears in my mind! Thank you.

Tim
(e-mail address removed)
 
Back
Top