continuous form question (1 Viewer)

Jim W

Registered User.
Local time
Today, 19:54
Joined
Feb 4, 2003
Messages
198
I have a continuous form setup that has a check box field (Yes / No) I also have a command buttom to preview data. How can I code the command button for each record so that is the check box = No then the command button is not visible. I had code in the on open but it seem to either make the command button visible for all records on invisible for all.

Jim
 

GabrielR

Registered User.
Local time
Today, 14:54
Joined
Oct 6, 2004
Messages
63
Jim W said:
I have a continuous form setup that has a check box field (Yes / No) I also have a command buttom to preview data. How can I code the command button for each record so that is the check box = No then the command button is not visible. I had code in the on open but it seem to either make the command button visible for all records on invisible for all.

Jim


mmm I think it could be something like (from the top of my head) :

in the OnCurrent Event of the Subform

Code:
If Me.Checkbox = -1 Then
[Forms]![YourForm].[Yourbutton].Enabled = True
Else
[Forms]![YourForm].[Yourbutton].Enabled = False
 

Jim W

Registered User.
Local time
Today, 19:54
Joined
Feb 4, 2003
Messages
198
Its not a subform its a continuous form

Jim
 

GabrielR

Registered User.
Local time
Today, 14:54
Joined
Oct 6, 2004
Messages
63
Jim W said:
Its not a subform its a continuous form

Jim


Then is much more easier... See attachement
 

Attachments

  • FindiExample.zip
    32.2 KB · Views: 115

Jim W

Registered User.
Local time
Today, 19:54
Joined
Feb 4, 2003
Messages
198
The difference is that the command button I'm want to disable is on the form not the header or footer. Each record or form has the button.

Jim
 

GabrielR

Registered User.
Local time
Today, 14:54
Joined
Oct 6, 2004
Messages
63
Not a very elegant workaround

Jim W said:
The difference is that the command button I'm want to disable is on the form not the header or footer. Each record or form has the button.

Jim

What you need is to set Conditional formatting, unfortunately Command buttons do not support that feature.. Maybe in the next version of Access :confused:

Well there is a work around to that, but before let me state that Ihave found that putting controls inside records is not a good practice when using Continuous forms, every single function can be done using buttons on the header/footer, or putting the continuous form inside an unbound form and seeting the controls on the unbound form. My advise would be to put the controls in the header and work from there...

That being said:

You need to set a Textbox and use it as a button, a textbox is one of the few controls that support Conditional formatting.

See Example.

I set up a text box and set conditional formating to Disable the textbox depending on the value of the checkmark, also once you click the textbox the focus is sent to another control on the form so, for the casual user the textbox will almost appear as a button...

As far as I know that is the only solution....
 

Attachments

  • FindiExample.zip
    31.6 KB · Views: 136

Users who are viewing this thread

Top Bottom