Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable Or not , that is the question

Status
Not open for further replies.

dominicgingras

Technical User
Jul 15, 2002
53
CA
I have a form that I use to do my order entry. When the order is complete, I want to disable some of the sub-form.

So far I have use something like that

Private Sub Form_Current()

If [Status] = "Invoiced" Then
ReadOnly = "Read Only"
InvoiceButton.Enabled = False

Me.AllowEdits = False
[Forms]![WorkOrder].[TasksSubform].Form.AllowEdits = False
[Forms]![WorkOrder].[BillingDetailsSubform].Form.AllowEdits = False
[Forms]![WorkOrder].[NoteSubform].Form.AllowEdits = False
[Forms]![WorkOrder].[SchedulingSubform].Form.AllowEdits = False


End If

If [Status] = "Ordered" Then
ReadOnly = ""
Me.AllowEdits = True
[Forms]![WorkOrder].[TasksSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[BillingDetailsSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[NoteSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[SchedulingSubform].Form.AllowEdits = True

InvoiceButton.Enabled = True
End If

If [Status] = "Pending" Then
ReadOnly = ""
Me.AllowEdits = True
[Forms]![WorkOrder].[TasksSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[BillingDetailsSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[NoteSubform].Form.AllowEdits = True
[Forms]![WorkOrder].[SchedulingSubform].Form.AllowEdits = True


InvoiceButton.Enabled = False
End If
End Sub


As you can see this is very long.


Also I get a problem if my user press a button on the form that display a listbox with some choice, when he go back to the from, It is not disable anymore

This is probably not the right methos for doing this.

Any idea?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top