Next task

ChrisC

Registered User.
Local time
Today, 00:49
Joined
Aug 13, 2019
Messages
90
Ok, so I have now got a working image database that works a charm. I have successfully added various check boxes and search (filter) criteria using what I learnt so far from help on this forum so I'm very happy!

My next task is to have a button appear if a check box on a row is checked; there are multiple rows on my form and I only want the button to appear on lines where that tick box is checked.

Ultimately, the button in question will be clicked for users to open a .PDF file; the path of which is stored in the table for this form.

I have been using the following syntax but can only make the button appear on ALL lines or none of them.


If Me.Check60 = -1 Then
Me.Command62.Visible = True
Else
Me.Command62.Visible = False
End If


Excuse the naming, but Check60 is the tickbox in question, and Command62 is the button I want to appear.

The tick box is automatically checked based on information in the table; nothing is "updated" as such when the form is being viewed.

I have read on some websites that this simply isn't possible - buttons can only be shown "all or nothing"... is that true? I cant find an alternative solution without having the full path of the PDF file shown - which to me just looks untidy (hence why I want to swap it to a simple button).

Thanks as always,
Chris
 
If you are using a continuous form, there is actually only one set of controls but displayed multiple times. This means the buttons are indeed all or nothing.

However you could use conditional formatting to disable a textbox control where your checkbox is false...but CF isn't available for buttons

BTW I woulds use meaningful names rather than Check60, Command62 etc
 
Last edited:
if it is a continuous form that you have, you can't.
try replacing the command button with unbound textbox or label and use conditional format to change its font's forecolor.
 
Hi Colin,

Thanks, at least that stops me going round in circles for hours ha ha.

Conditional Formatting is greyed out for buttons, so I'm presuming that simply some controls can not have formatting applied?

thanks

PS - names changed now :)
 
if it is a continuous form that you have, you can't.
try replacing the command button with unbound textbox or label and use conditional format to change its font's forecolor.

Hi Arnelgp,

I will give that a try - thank you :)

I guess that would get around not being able to apply formatting to a button... make something else look like a button instead.

thank you
 
Hi Chris
Conditional formatting is used for textboxes and comboboxes.
AFAIK it doesn't work for any other types of controls.

People often use labels in place of buttons but that won't help in your case as you can't apply CF to a label as stated above
 
thank you all - I have got the text box to be active/not-active based on the tick box value; but is there a way to make the greyed out, non active text boxes completely invisible?
 
You can’t hide objects using CF. However you could make the text box fore colour and back colour the same as your form colour

If so you won’t need to disable them as well
 
Last edited:
Hi Pat,

You're correct about the checkbox; it is simply to show whether "that" line has a PDF - but now you highlight it, I guess it is redundant. The checkbox is never updated from within the form - it is simply there as an instant visual aid to whether there is a file or not.

Forgive my ignorance - in a Query, how do I enter a calculated field? That is to say - where do I enter the calculation? Using the wizard I have a query that now shows 2 columns: the PrimaryKey, and one showing the PDF path if there is one, or simply blank if there isn't.

I must admit, "normally" in everything else I do, I do rename things to something meaningful from the start. This time I just didn't do it for some reason (probably because im rushing between this and doing my job!). Thank you though for the heads up - you are of course correct; naming things straight away is the best policy every time :)


Thanks
Chris
 
Well I would say that I have achieved (sort of) what I want - certainly good enough to be able to move on with the project!

So thanks once again to all for the help!

Watch this space for the next cry for help... working out how to do a query to show for a given partID (entered in a text field) all the WHLocat (warehouse locations) that are associated with the Part and the qty in each of those locations (quantity and locations stored in a new table).

I think that will be for a different thread though (after I have had a go myself of course :))

thanks everyone
Chris
 

Users who are viewing this thread

Back
Top Bottom