mike60smart
Registered User.
- Local time
- Today, 05:34
- Joined
- Aug 6, 2017
- Messages
- 2,151
Hi Everyone
I have the following Form layout.
Main Form - frmCustomerOrders
Subform1 - frmOrderItemsSubform
Subform2 - frmOrderItemSizesSubform
To save the user having to use a Combobox to insert a RowNr for each Record on Subform2
On subform2 I have an Unbound Control named "txtSN" and a Control named "RowNr"
The Record Source of "txtSN" is set as =SerialNumber([Form])
Then in the AfterUpdate of A Control named cboCustomer
The After Update does not work using the following Function:-
Any help appreciated/
On Subform 2 I have the following Function:-
I have the following Form layout.
Main Form - frmCustomerOrders
Subform1 - frmOrderItemsSubform
Subform2 - frmOrderItemSizesSubform
To save the user having to use a Combobox to insert a RowNr for each Record on Subform2
On subform2 I have an Unbound Control named "txtSN" and a Control named "RowNr"
The Record Source of "txtSN" is set as =SerialNumber([Form])
Then in the AfterUpdate of A Control named cboCustomer
Code:
Private Sub cboCustomer_AfterUpdate()
Me.RowNr = Me.txtSN
End Sub
The After Update does not work using the following Function:-
Any help appreciated/
On Subform 2 I have the following Function:-
Code:
Private Function SerialNumber(ByVal sourceForm As Form) As Variant
10 On Error GoTo Catch
20 SerialNumber = Null
30 With sourceForm.RecordsetClone
40 .Bookmark = sourceForm.Bookmark
50 SerialNumber = .AbsolutePosition + 1
60 End With
Done:
70 Exit Function
Catch:
80 If Err.Number <> 3021 Then MsgBox Err.Number & ":" & Err.Description, vbExclamation, "SerialNumber"
90 Resume Done
End Function