
16-02-18, 15:06
|
| Όνομα: ΝΑΣΟΣ Έκδοση λογισμικού Office: Ms-Office 2007, Ms-Office 2016 Γλώσσα λογισμικού Office: Ελληνική | | Εγγραφή: 14-10-2010
Μηνύματα: 455
| |
Καλησπέρα σε όλους.
Παναγιώτη δημιούργησε μία λειτουργική μονάδα (module) και κάνε αντιγραφή τον
παρακάτω κώδικα: Κώδικας: Public Function RowNum(frm As Form) As Variant
On Error GoTo Err_RowNum
'Purpose: Numbering the rows on a form.
'Usage: Text box with ControlSource of: =RowNum([Form])
With frm.RecordsetClone
.Bookmark = frm.Bookmark
RowNum = .AbsolutePosition + 1
End With
Exit_RowNum:
Exit Function
Err_RowNum:
If Err.Number <> 3021& Then 'Ignore "No bookmark" at new row.
Debug.Print "RowNum() error " & Err.Number & " - " & Err.Description
End If
RowNum = Null
Resume Exit_RowNum
End Function
Αποθηκεύεις και κλείνεις το module.
Στη συνέχεια.
Στην υποφόρμα και σε μορφή σχεδίασης δημιουργείς ένα αδέσμευτο πεδίο ->Δεδομένα->
Προέλευση στοιχείου ελέγχου γράφεις : =RowNum([Form]) |