Continous Forms (sub-form)

A

Anthony Viscomi

I have the following code that resides within a Sub Form which is Continous:
Private Sub Action_Taken_Click()
If Me.Action_Taken.Value = True Then
Me.cboAction.Visible = True
MsgBox "Select an Action", vbInformation, "Action Required"
Me.cboAction.SetFocus
Else
Me.cboAction.Visible = False
End If
End Sub

The code runs fine; except for that when the Action_Taken is either True or
False all cboAction(s) on all records all Visible or not Visible. I assume
that there may be some sort of "Current Record" code that I should be using.
Can anyone direct me?

Thanks in advance! (Sorry for the re-post)
Anthony
 
A

Albert D. Kallal

I certainly have a lot of continues forms where I set the controls 'enabled'
property on/off. While this actually makes all instances of the control go
disabled, I actually find this works quite well. I mean, when you move
to the next row, those columns that you enable, or disable can then
be set. So, you could set the controls visible property as you move
the cursor up/down through the

In fact, I actually PREFER the above behavior, as then during
data entry it is VERY easy to see that the column in question
is enabled.

In place of a VERY HARD TO READ checkerboard pattern of enabled, and
disabled boxes,
, you get a very nice enable/display view as I move the cursor up /down.

I have uploaded a gif animation of me navigating in a form, both of the two
screen shots will give you an idea of how this looks.

http://www.members.shaw.ca/AlbertKallal/HideColumn/index.htm

The only real problem I see with your setup is that you have a msgbox prompt
fired from a continues form..but, for the most part, you can do this...
 
A

Anthony Viscomi

Albert,
Thank-you for your response; but I'm not quite sure if I understand.
Private Sub Action_Taken_Click()
If Me.Action_Taken.Value = True Then
Me.cboAction.Visible = True
MsgBox "Select an Action", vbInformation, "Action Required"
Me.cboAction.SetFocus
Else
Me.cboAction.Visible = False
End If
End Sub

The only time that I want the cboAction visible is when the Action_Taken
(check Box) is true.This codes resides behind the "onclick" event for the
Action_Taken checkbox.

As I stated, when the on click event is true all records display the
cboAction even though their respective Action_Taken value(s) are false.
 
A

Albert D. Kallal

You would have to place the following code in the on-current event

if me.action.taken = True then
me.cboAction.visiable = true
else
me.cboAction.visiable = false
end if

As that web page animation shows, you are still faced with the problem of
"all" controls showing/hiding, but as I said, it don't look that bad...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top