Click to See Complete Forum and Search --> : Disabling buttons in Access


galneweinhaw
June 9th, 2004, 01:37 PM
(see attached pic)

Right now, when any of the "Baked" is ticked or unticked all the buttons enable/disable.... how do I make it so each button responds to it's own record's tick box?

here is the code I used in AfterUpdate:

Dim boolBaked As Boolean
boolBaked = Me!Baked
If (boolBaked = True) Then
Me!btnEditBakeDetails.Enabled = True
End If
If (boolBaked = False) Then
Me!btnEditBakeDetails.Enabled = False
End If

x92850
February 28th, 2005, 10:47 AM
Unpossible if your forms is constructed like that.
There is only 1 control btnEditBakeDetails on your access form;
which visualy is multiplied per record, but not internally.

If you don't have too many controls (and records to manage) you could try to create a matrix of controls (e.g. 10 txtPlate, 10 cmbQuality, etc...) but this is a lot of work, believe me!

Or, in the on current events, you could set the enabled/disabled status, but then you don't have the global view of course.


Think different and construct another form based on other concept.

jacander
March 4th, 2005, 01:16 PM
Try this it will work on an individual record basis

private sub btnEditBakeDetails_click()
if baked.value = true then
'what ever is supposed to happen
end if
end sub