button on a continious form (visible/not visiable )question

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 04:51
Joined
Nov 8, 2005
Messages
3,309
OK guys I have a Conintuous form which I am allocating monies in /status

THe button i have will mark the record as settled (with a date stamp)

However what I wanted to do is have a drop down box with Outstanding (default) part paid and settled

now below makes the button appear/disappear for all records and not just the one I am on - its bound to be something simple (me.settlement is the name of the button)

pointers would be appricated

G
code follows

Private Sub status1_AfterUpdate()

If Me.status1 = "settled" Then Me.settlement.Visible = True

If Me.status1 = "Oustanding" Then Me.settlement.Visible = False

If Me.status1 = "PartPaid" Then Me.settlement.Visible = False

Refresh


End Sub
 
The button is related to the form and not its underlying recordset, which is why it's always visible or always invisible. What you are describing is an attribute of each record, so you would need a field in the record itself showing the settled state. If you put a click event on that field, you could invoke an unbound comb box with the three states you identify and which updates the field with the correct value. Seems a bit inelegant to me for the application you describe. perhaps someone else will have a better solution than mine.
 
Hmm . thanks for the response .. I have seen it done - but cannot remember where - still researching this one - I have a get round - but its not what I am after

my get round is a bit long winded and I have not tried it yet - but effectively I intend to look the settlement date (one of the functions of the button settlement) and if date is >1 then button not visible - problem is that will not be "live" (and I am not sure if it will work)

G
 
First off, as NickHa said, in a Continuous View Form you cannot make Controls either Visible or Not Visible on a Record-by-Record basis; it's all or nothing.

Secondly, using a Command Button for this kind of thing is a very odd approach. Most people would either have a Checkbox, bound to a Field in the underlying Table and ticked to denote when the account is 'settled.' Even better, simply use the AfterUpdate event of the Combobox and when the Combobox.Value = "Settled" then apply your Date/Time Stamp.

Linq ;0)>
 
First off, as NickHa said, in a Continuous View Form you cannot make Controls either Visible or Not Visible on a Record-by-Record basis; it's all or nothing.

Secondly, using a Command Button for this kind of thing is a very odd approach. Most people would either have a Checkbox, bound to a Field in the underlying Table and ticked to denote when the account is 'settled.' Even better, simply use the AfterUpdate event of the Combobox and when the Combobox.Value = "Settled" then apply your Date/Time Stamp.

Linq ;0)>

Done this approach on my banking element - ideally I would of tied it to the banking screen - but some of our accounts only part pay otherwise 1 process for the whole lot ...

I had wanted to do some semi clever checking - so if its not flagged as settled then you don't get to see the button - this would allow part payments to be entered - I will have to re-think this one ....
G
 
And I will throw my agreement in with Nick and Linq. A control needs to be bound to the field in the recordset in order to be individually controlled within a Continuous form or Datasheet view form.
 
Here is trick that I've used before that might help:

You can enable/disable unbound controls on a line-by-line basis in Access 2010 on a continuous form using Conditional Formatting. The button will still be visible but it will be greyed out and not clickable.

Let me know if this might be of interest to you and I can help you set it up.
 

Users who are viewing this thread

Back
Top Bottom