C
Confused
Customers/Inventory
1) On the main form, (Customers)I need to lock some controls, but keep some
combo boxes unlocked that I use for searching. But I need the fields
unlocked when on a new record. The subform doesn't need to be locked. I
found this, but it doesn't unlock the combo34 except on new records, which is
what the code does to all of the controls.
Private Sub Form_Current()
Dim ctrl As Control
On Error Resume Next
If Me.NewRecord Then
For Each ctrl In Me.Controls
ctrl.Locked = False
Next ctrl
Else
For Each ctrl In Me.Controls
ctrl.Locked = (ctrl.Name <> "combo34")
Next ctrl
End If
End Sub
2) I have the main form and subform tied together by Customer ID. When I go
to a new record, I try to click down a combo box with the Customer Names
bound to customer ID. It then tells me "Cannot edit field it's bound to an
auto number Customer ID. So how would I add records?
3) When I advance records, if a customer has, say four items in inventory,
I have to flip through four instances of the same record before it advances
to the next customer.
1) On the main form, (Customers)I need to lock some controls, but keep some
combo boxes unlocked that I use for searching. But I need the fields
unlocked when on a new record. The subform doesn't need to be locked. I
found this, but it doesn't unlock the combo34 except on new records, which is
what the code does to all of the controls.
Private Sub Form_Current()
Dim ctrl As Control
On Error Resume Next
If Me.NewRecord Then
For Each ctrl In Me.Controls
ctrl.Locked = False
Next ctrl
Else
For Each ctrl In Me.Controls
ctrl.Locked = (ctrl.Name <> "combo34")
Next ctrl
End If
End Sub
2) I have the main form and subform tied together by Customer ID. When I go
to a new record, I try to click down a combo box with the Customer Names
bound to customer ID. It then tells me "Cannot edit field it's bound to an
auto number Customer ID. So how would I add records?
3) When I advance records, if a customer has, say four items in inventory,
I have to flip through four instances of the same record before it advances
to the next customer.