|
From: Dhonan on 4 Jul 2008 14:51 I have a continuos form with a command button that I would like the caption of that command button to change depending on the transaction type of the record. For example, if the first record displayed is transaction type "123" then the caption should be "display report for trans 123". If the second record is transaction type "456", then the caption should read "update trans 456". I have tried using "on current", but that changes the caption on every button on every line. Any help would be appreciated it. Thanks
From: Arvin Meyer [MVP] on 4 Jul 2008 15:19 I don't think that's possible in a continuous form. You could place the button in the form's header or footer and run your code in the form's Current event. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Dhonan" <Dhonan(a)discussions.microsoft.com> wrote in message news:566226C8-7866-49B0-A8C4-783652D74CC7(a)microsoft.com... >I have a continuos form with a command button that I would like the caption > of that command button to change depending on the transaction type of the > record. > > For example, if the first record displayed is transaction type "123" then > the caption should be "display report for trans 123". > > If the second record is transaction type "456", then the caption should > read > "update trans 456". > > I have tried using "on current", but that changes the caption on every > button on every line. > > Any help would be appreciated it. > > Thanks
From: Dhonan on 4 Jul 2008 15:28 You may be right. The only way I have been able to partially do this is to create a text box that has logic to display what I want the caption to say and then place it over the top of the command button. Then sent the on-click event for both the text box and command click to the same thing. But this is a little clugy and the pointer doesn't display when the mouse is moved over the text box (even though the click still works) "Arvin Meyer [MVP]" wrote: > I don't think that's possible in a continuous form. You could place the > button in the form's header or footer and run your code in the form's > Current event. > -- > Arvin Meyer, MCP, MVP > http://www.datastrat.com > http://www.mvps.org/access > http://www.accessmvp.com > > "Dhonan" <Dhonan(a)discussions.microsoft.com> wrote in message > news:566226C8-7866-49B0-A8C4-783652D74CC7(a)microsoft.com... > >I have a continuos form with a command button that I would like the caption > > of that command button to change depending on the transaction type of the > > record. > > > > For example, if the first record displayed is transaction type "123" then > > the caption should be "display report for trans 123". > > > > If the second record is transaction type "456", then the caption should > > read > > "update trans 456". > > > > I have tried using "on current", but that changes the caption on every > > button on every line. > > > > Any help would be appreciated it. > > > > Thanks > > >
From: NoodNutt on 4 Jul 2008 20:28 You could have multiple command buttons, each with different text. Make then the same size and stack them on top of each other. In the OnOpen() event diasble them Me.MyCmdBtn1.Enabled=False Me.MyCmdBtn1.Visible=False And so on. In the AfterUpdate of the Combo the user select the Trans type You could then have a Case Select Case1 Me.MyCmdBtn1.Enabled=True Me.MyCmdBtn1.Visible=True HTH Mark.
From: Dhonan on 4 Jul 2008 23:06 Thanks - in my case though it is a little different. The trans type is not selected by the user, but is already on file. I want the display to change based on the transaction. However, I do like your solution and will use it on other applications I am sure. "NoodNutt" wrote: > You could have multiple command buttons, each with different text. > > Make then the same size and stack them on top of each other. > > In the OnOpen() event diasble them > > Me.MyCmdBtn1.Enabled=False > Me.MyCmdBtn1.Visible=False > > And so on. > > In the AfterUpdate of the Combo the user select the Trans type > > You could then have a Case Select > > Case1 > Me.MyCmdBtn1.Enabled=True > Me.MyCmdBtn1.Visible=True > > HTH > Mark. > > > >
|
Next
|
Last
Pages: 1 2 Prev: how can i play a 'wav' file in access 2007 Next: Command BUtton Caption on continuous forms |