hi,
i have a check box.
i want that when i open my form if the check box checked the "ID" field is show and if the check box not checked the "ID" field not show(hide)
thank you!
miki
hi,
i have a check box.
i want that when i open my form if the check box checked the "ID" field is show and if the check box not checked the "ID" field not show(hide)
thank you!
miki
You can place VBA code in your form's current event.
if me.id.value = -1 then
me.id.visible = true
else
me.id.visible = false
end if
i try this but the code not working for me
i try also to write this exp:
but it not work too ((Code:iif(1=1,[firstName].[Visible]=False,MsgBox(1))
Use your form's current event. You can create an event handler by going to the form's property window.
.
.
Once you are looking at the form's properties, you can select the "Event" tab and click the Elipses (...) button next to the "On Current" field. Select "Code Builder" This will launch the VBA Editor and you can paste the code in there.
Code:If Me.id.Value = True Then Me.firstName.Visible = True MsgBox "The value of Id is True" Else Me.firstName.Visible = False MsgBox "The value of Id is False or Is Null" End If
i know!!!
but its dont work.
it is very srange.
i try to click on three points(...) button behind the current event onLoad.
its open to me the VBA code editor
with this function:
and i write inside the function msgBox(1)Code:private sub myForm onLoad end sub
but i dont see the msgBox when i open my form
it is crazy me!
in other project it is work perfect!
maybe i off all VBA code in this project?
If you want to call a function in your form's load event that is fine. The code I am showing you is to address your question about hiding a control on your form based on a condition. The code I provided uses an If Then statement. If you place that code in the form's current event, it will fire every time the user navigates to a different record. You only need to adjust the code to match the names of your controls
Me.id will need to be adjusted to match the name of your control that you want to evaluate, ie me.YourControl and Me.firstName to Me.HideThisControl or something...