Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disbale form fields for differnet records

Status
Not open for further replies.

mphayesuk

IS-IT--Management
Apr 22, 2003
46
GB
Is it possible to disble form fields for different records. ie

Form1

Field1
Field2
Field3
Field4

For record 1, fields 1,2,4 are enable
For record 2, fields 3 are enable
For record 3, fields 2,4 are enable

Thanks
 
How are ya mphayesuk . . . . .

If you have Access 2000 or higher its possible to [purple]Conditional Formatting.[/purple]

Only question is: What would be your [blue]criteria[/blue] for determining which fields to enable/disable?

Calvin.gif
See Ya! . . . . . .
 
Not bad thanks....

I see where your going with this.... I thought about putting in an extra 3 fields in my table and set the contents to 1 if I wanted the field disabled (ie through vb code)... I was hoping for an internal access command that could disable fields.... If you dont think there is I will take your advice for conditional formatting and start writting some code.

Thanks
 
mphayesuk . . . . .

In [purple]Conditional Formatting[/purple] you'll be setting the [blue]Enable[/blue] property to enable/disable the textboxes.

Even if you add the three fields, [blue]criteria[/blue] for tagging is still the issue . . .

Calvin.gif
See Ya! . . . . . .
 
Take a look at this:


Scroll down to the last few posts.

Basically I had wanted to display only fields that were valid for specific records and then rearrange the textboxes neatly on the form.

Although it looks complicated it's pretty easy to do. I did it, and I'm far from a programmer.
 
Yup...as AceMan points out, what is the criteria which determines which fields are enabled?

If each record contains data that determines which fields are to be enabled, then the quick way is to create a sub routine that evaluates the criteria, then call it from the necessary form events. For example, call it after retreiving a record, after deleting a record, after saving a record, before update, after update...and etc. Then test it covering all events to make sure each record enables/disables controls accordingly.

HTH,
Mike Dorthick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top