form design question

  • Thread starter Thread starter Christophe Schoofs
  • Start date Start date
C

Christophe Schoofs

I am a beginning MS Access user and I have 2 problems designing a form:

1)
I have 2 fields in a form:
"Video available" -> Yes/No
"Video rating" -> x/10
My question: how can I make the "Video rating" field only appear on the form
when the "Video Availabe" field is checked "Yes"?

2)
I want to list several internet-links for each record (in a pcgame
database), but the number of links can be different for each record; for
example the first record contains 3 links, the second record 1 link, the
third record 18 links, etc etc. Is this possible in some way or do I have to
make a field for each different internet link and leave most of them empty
when I don't use them on that form?

Thanks for helping me out,
Christophe
 
Christophe-

1) In the Current event of the form and the AfterUpdate event of the Video
available control, test the value of the control and show/hide the rating
field. If the available field is a true yes/no value, you can do:

Me.VideoRating.Visible = Me.VideoAvailable

2) You probably need a separate table to contain the links and relate the
rows back to the main table by the primary key of the main table. Display
the links in a subform on the main form - this allows you to have 0 to an
infinite number of links per record without having to waste any space in
your tables.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Thanx for replying! I have some problems with your first answer though; I'm
not an experienced VBA user - could you please give some more details about
how to do this?
Thank you!
 
Never too late to learn!

Open your form in Design View. Select the form. Open the Properties window
and click the Event tab. In the On Current property, select [Event
Procedure]. Click the Build button next to the property (...) to open the
Visual Basic module for the form with the skeleton code for the event. On a
blank line in the procedure, enter:

Me![<name of the video rating control>].Visible = Me![<name of the video
available control>]

... you'll have to supply the actual control names where I've indicated
above.

Go back to the Access window and select the video available check box. Find
the After Update property in the Properties window, change it to [Event
Procedure], and click the build button. Enter the same line of code as
shown above. Choose Compile from the Debug menu and save your changes.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top