momaw nadon
Registered User.
- Local time
- Yesterday, 22:04
- Joined
- Apr 19, 2013
- Messages
- 10
Hi,
Novice to Access, working on Access 2010.
First problem: looking for code to allow me to do multiple things with one button. I can get part of what I need it to do working, as the button will enable fields, change display text (“edit” to “save” and back again), and disable/enable search. Though I’ve been unable to return the disabled form fields once the button it clicked again.
Reason for disabling search is to prevent mistakes and incomplete entries.
Here is the code I have so far:
Second problem: the above form has a subform. I have the fields disabled upon opening of both main and sub. I don’t have a problem with the main navigation features working with fields disabled, but do have the problem with nagivation being disabled on subform. I need the nagivation on subform to work when fields are disabled, so is there a way to correct.
Thank you for your help on my issues.
MN
Novice to Access, working on Access 2010.
First problem: looking for code to allow me to do multiple things with one button. I can get part of what I need it to do working, as the button will enable fields, change display text (“edit” to “save” and back again), and disable/enable search. Though I’ve been unable to return the disabled form fields once the button it clicked again.
Reason for disabling search is to prevent mistakes and incomplete entries.
Here is the code I have so far:
Code:
[SIZE=3][FONT=Calibri]Private Sub Form_Load()[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.sfrm.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.site.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.local.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.add.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.city.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.state.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.zip.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]End Sub[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Private Sub cmdedit_Click()[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.sfrm.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.add.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.city.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.state.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Me.zip.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] If cbosearch.Enabled = True Then[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cbosearch.Enabled = False[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cmdedit.Caption = "Save"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Else[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cbosearch.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cmdedit.Caption = "edit"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] End If[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]End Sub[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Private Sub Form_Current()[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cbosearch.Enabled = True[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] cmdedit.Caption = "edit"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]End Sub[/FONT][/SIZE]
Second problem: the above form has a subform. I have the fields disabled upon opening of both main and sub. I don’t have a problem with the main navigation features working with fields disabled, but do have the problem with nagivation being disabled on subform. I need the nagivation on subform to work when fields are disabled, so is there a way to correct.
Thank you for your help on my issues.
MN