However, not being familar with this type of coding in Access, do I just paste that into the properties dialogue area for update event, or put it in expression builder etc....
You'll want to use the code builder in this case -- it'll open up the VB code window.
The Me term refers to the current form, saving some code vs typing
forms![formname].controlname
Me.controlname is the same thing as long as the info is on the current form.
Just replace fieldname with the name of your field and you'll be good to go.
ah, thanks. Yes, it sort of works, but this is a continous form and it seem to show them all. I think I also it need to be in some sort of checkbox equals true option instead of after update? Any ideas?
Continuous forms throw a whole new wrench into things. Visibility will affect every record in the form, since Access basically says that there is only one text box, no matter how many rows you have.
As far as making it visible on true only, your code would be something like this:
Code:
if me.checkbox then
me.textbox.visible = true
else
me.textbox.visible = false
end if
hmm, ok, so I cant do it then? The code you gave me refers to textboxes? It tried it with fieldnames and put the checkbox name, ie Check20 inplace of checkbox, but it throws a wobbly!
To make this easier, what is the name of the checkbox you are checking, and what is the field you're trying to make visible?
I was assuming you were trying to make a textbox visible (you'd put the name of whatever field you want to make visible in place of textbox). It doesn't have to be a textbox, it could be another checkbox or combobox or anything
I have a combo dropdown called LimitedEditionTotal which stores a values, 10, 20 etc... and a checkbox called Check20 (default name) that I want to use to control the visibility of the LimitedEditionTotal field.
I have set the default visibility to false as WAZZ above suggested.
I would like it hidden when you first create a new record, then controlled by the checkbox there after.
that seems to apply to all the fields again, and produces a debug error on a new entry :-(
Just to clarify, I trying to hide the entry in 1 field in 1 record of the continous form. The code above applys the the field across all records in the continous form
ah, ok thanks. What would happen if I apply this code to a single version of the form, but then look at the continous version. Would it do strange things?
I'm sure I can use this code somewhere so all is not lost. Thanks for your help.
***
I guess it wouldnt effect the continous form as it is a different form so the settings wont apply!
Do want to make the entry/typing in the textbox invisible or the whole box itself?
If the entry/typing then with conditional formatting you change the font colour to be the same as the textbox background colour. To make the textbox invisible then change it to transparent background.