Visible button on Sub form
am 12.11.2007 22:57:16 von feeman
I have a form in access 2000 with a combo box containing names, this
is linked to a sub form by the name index. on the sub form is a
button that when pressed automatically enters the date into the date
field. Now my problem is that when someone comes in and finds their
name and presses the sign in button it is no longer visible so they
can not sign in more than once that day.
My trouble is that i can nor remember how to use the button on the sub
form for the life of me, and it would be easier to ask the question
rather than wait for it to come back.
on the combo box i have an afterupdate function
me.(need the bit that selects the button on the sub form).visible =
True
And on the sign in btn i have the following code.
me.date = Now()
docmd.gotocontrol (i need to now the bit that switches the control to
the combo on the main form)
me.sign_in_btn.visible = false
could someone help with the blanks or explain how you activate the sub
form on a main form ie
me.text1 = now()
puts the date in the text 1 box on the current form you are on,
but what is the code to put the date in a date text field on a sub
form (sub form called form2) that is on the main form (main Form
called Form1)
Hope someone can help with this keep coming up against sub form
problems.
Re: Visible button on Sub form
am 13.11.2007 01:50:56 von rkc
feeman wrote:
> I have a form in access 2000 with a combo box containing names, this
> is linked to a sub form by the name index. on the sub form is a
> button that when pressed automatically enters the date into the date
> field. Now my problem is that when someone comes in and finds their
> name and presses the sign in button it is no longer visible so they
> can not sign in more than once that day.
>
> My trouble is that i can nor remember how to use the button on the sub
> form for the life of me, and it would be easier to ask the question
> rather than wait for it to come back.
>
> on the combo box i have an afterupdate function
>
> me.(need the bit that selects the button on the sub form).visible =
> True
>
> And on the sign in btn i have the following code.
>
> me.date = Now()
> docmd.gotocontrol (i need to now the bit that switches the control to
> the combo on the main form)
> me.sign_in_btn.visible = false
>
> could someone help with the blanks or explain how you activate the sub
> form on a main form ie
>
> me.text1 = now()
>
> puts the date in the text 1 box on the current form you are on,
>
> but what is the code to put the date in a date text field on a sub
> form (sub form called form2) that is on the main form (main Form
> called Form1)
The controls on a form in a subform control can be referenced
using the Controls collection of the subform control.
So a command button named Command0 on the form in a subform control
can be referenced from the main form as:
Me.SubFormControlName.Controls("Command0").Visible = True
To return to the combobox on the main form from the command button
click event on the form in the subform control:
Me.Parent.Controls("Combo0").SetFocus