Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access

ResolvedVersion 2007

Kate has attended:
Access Introduction course
Access Intermediate course

Access

I am trying to design a form for our dealflow database that will hide certain criteria when a certain box is ticked. Reason for this is that it contains both individual projects and portfolios of projects - almost all of the fields are the same but there are a couple that only apply to projects and a couple that only apply to portfolios. How do I do this? Don't want to create two forms as there are 60 or 70 fields in total. Thanks!

RE: Access

Hi Kate

Thank you for your question

I have uploaded a database with one form in it. It has 4 text boxes and a check box. The check box has the following code attached to its "after update" event

Private Sub chk1_AfterUpdate()


If Me.chk1.Value = True Then

Me.txt1.Visible = False
Me.txt2.Visible = False
Me.txt3.Visible = False
Me.txt4.Visible = False

Else

Me.txt1.Visible = True
Me.txt2.Visible = True
Me.txt3.Visible = True
Me.txt4.Visible = True

End If

End Sub


This code will run everytime the value of the check box is altered. It gives you the general code that you would have to write. The key is to set the visible property of the relevant text box to "true" or "false".

I hope this helps. If you require further clarification please don't hesitate to repost

Regards

Stephen

Attached files...

ForumExample.accdb

RE: Access

Hi Stephen,

Thanks for getting back to me so quickly on this one. Unfortunately I don't seem to be able to open the sample database you've attached to the email - any idea why this is?

Many thanks,

Kate

Edited on Thu 3 Jul 2008, 11:06

RE: Access

Hi Kate

Thanks for getting back to me

Could you email the database back to me and I will have a look at it for you

my email address is stephenATstl-training.co.uk

Thanks

Stephen

Access tip:

Closing form after a certain time period

To make a form close automatically after a certain time period, you need to assign the close function to a macro.

Save the macro and ope up the form in design view. open the Properties sheet.

In the TimerInterval property enter the length of time you want the form open for. This should be in milliseconds, so for instance if you want the form open for 5 seconds enter 5000, for an minute enter 60000.

You now need to attach your macro (to execute the Close action) to the OnTimer event property of the form.



View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.