Fields question

master_dragon_1

Registered User.
Local time
Today, 18:34
Joined
Aug 27, 2003
Messages
19
I have a question to do with both tables and forms in access since they are connected in some way. The thing is this:

I am creating a book list. I want the following fields:
-Number (Autonumber)
-Name (Text)
-Type (text)
-Do i have it (yes/no)
-Rating (Number)

I have two questions.

1.How to i make the "rating" field available only if the "have?" field is set to yes. In other words if the "have?" field is ticked you can select the rating.

2.How do i make the rating like a drop down box so you can choose only a certain range for example 1-5. How can i make it in the shape of a drop down box with all the ranges in it.

Thanx
 
master,

You can use the GotFocus event for the rating field to do:

If Me.Have = False Then
MsgBox("Don't have it, can't rate it.")
Me.Have.SetFocus
Exit Sub
End If

You can use the combo box wizard in your form's design view to
specifiy that you want to enter the values for your combo box;
1;2;3;4;5

Wayne
 
Could you please tell me how to enter the event since i have never used codes
 
Right click the field, choose properties

Click on the event tab,
Find the right event, in this case On Got Focus click in the field and click the Dots button to the right of it.

Paste the code given above...

Regards

Edit:

P.S. As a general rule: Dont use spaces or special characters in field names !!! It will bite you in the future...
 
Is there any way that i can apply the enable/disable fields to the table as well???
 
same way except, offcourse, you put it somewhere else and than use me.rate.enabled = false

Try putting the code in the on current event of the form and in the on lost focus of the have field.

Regards
 

Users who are viewing this thread

Back
Top Bottom