Can Access skip fields conditionally?

jgreen

New member
Local time
Today, 02:21
Joined
Dec 30, 2004
Messages
3
We want the program to realize a field is a certain value and skip succeeding fields if that condition is right. For example, we have a field that is the outcome of a transplant. If the field says "Not Transplanted" we want to go through the succeeding fields about the transplant since they aren't germaine anymore....We've found the GoToControl but don't know how to use it and can't find any code examples....
Thanks.
 
I wouldn't use the GoToControl, I would use the .SetFocus property to move the cursor. But in any event, I don't like trying to control the cursor this way. I would toggle the .enabled property. That "greys" the background and won't let the cursor tab into the controls you don't want them to use. Controlling the cursor will only frustrate the users. They'll understand the visual clue that the .enabled property sends. Don't forget, you need to set both sides of the If and you need to execute the code in two places - the form's onCurrent event and the control's AfterUpdate event.

Code:
If Me.SomeControl = "some value" Then
    Me.ctl2.Enabled = False
    Me.ctl3.Enabled = False
Else
    Me.ctl2.Enabled = True
    Me.ctl3.Enabled = True
End If
 
skip pattern

Is there a way to do this skip code with out using coding?
 
Unless you have the ability to mind-meld with Access, how would it know what to skip?
 
yes in access 2003 right click a control and use conditional formatting.
You can make expressions referring to other fields. If you want to skip set the default record disabled (in the conditional formatting it's the little box) or set your conditions to disable the field.
When using your tab in the form you will notice access automatically skips the disabled fields.
 
1. The conditional statements you use in the conditional formatting would be the same conditional statements you would use if writing VBA.
2. Using conditional formatting, you can refer to other fields to determine the formatting for the current control but you can' set the formatting for other controls from the current control.
 

Users who are viewing this thread

Back
Top Bottom