If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
cmdButton Not refreshing in OnChange event in Split form
I have a split form with a command button on it called btnCloseBatch. I want
the button to be enabled when the BatchStatus is Open and Disabled when the BatchStatus is closed. Using the form's Curent Event I've added code like: Private Sub Form_Current() if Me!BatchStatus = "Open" Then btnCloseBatch.Enabled = True Else BtncloseBatch.Enabled = False End if End Sub When you tab through the fields on the form the Button displays as expected. However, if you use your mouse and click on a record in the Split window and make it the current record, the button does not display as expected. If you move the mouse over the button it will repaint correctly. How do I get the button to apear correctly in the Form_Current Event? Before you suggest using Repaint, it doesn't fix the problem. thanks in advance for your reply. |
#2
|
|||
|
|||
cmdButton Not refreshing in OnChange event in Split form
Sorry, I should have mentioned this is Access 2007.
"-james" wrote: I have a split form with a command button on it called btnCloseBatch. I want the button to be enabled when the BatchStatus is Open and Disabled when the BatchStatus is closed. Using the form's Curent Event I've added code like: Private Sub Form_Current() if Me!BatchStatus = "Open" Then btnCloseBatch.Enabled = True Else BtncloseBatch.Enabled = False End if End Sub When you tab through the fields on the form the Button displays as expected. However, if you use your mouse and click on a record in the Split window and make it the current record, the button does not display as expected. If you move the mouse over the button it will repaint correctly. How do I get the button to apear correctly in the Form_Current Event? Before you suggest using Repaint, it doesn't fix the problem. thanks in advance for your reply. |
#3
|
|||
|
|||
cmdButton Not refreshing in OnChange event in Split form
Okay,
Not sure why it did not work before , but Me.Refresh works. After doing some digging I tried it again, and now the form is updating correctly when you click on a Split form line item. -james The resulting code resembles: Private Sub Form_Current() if Me!BatchStatus = "Open" Then btnCloseBatch.Enabled = True Else BtncloseBatch.Enabled = False End if Me.Refresh End Sub |
Thread Tools | |
Display Modes | |
|
|