|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help! MY brain has hit a black hole.
I have set the Allow Edits property of my main form to NO, created a command button to allow edits and change the back color and cmd button text. What code do I have to add and where do I add it to open up the subform for editing?? Also can I change the back color of all the controls on both forms from white to gray on form open with code? If so what would be an example of the code. Thanks for your help! Below is the code that I have written for the command button. Dim ctl As Control Dim lngBackColor As Long Me.AllowEdits = Not (Me.AllowEdits) If Me.AllowEdits = True Then Me!cmdEditRecord.Caption = "Lock" lngBackColor = vbCyan Else Me!cmdEditRecord.Caption = "Edit Record" lngBackColor = vbWhite End If For Each ctl In Me.Controls If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then ctl.BackColor = lngBackColor End If End Sub |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Open subform for editing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|