Sorry - the above was pasted in from a Word document and the formatting has not been repeated. Hope the following code will be more intelligible!
Public Function SBCStart()
Public Sub RecordsCheck()
'Routine to check whether total records in SBCMembers Table agrees with
'Serial number of last record and if not to issue a warning message to user.
Dim dbs As Database, rst As Recordset
Dim tblrecs As Integer, lastrec As Integer
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SBCMembers")
tblrecs = rst.RecordCount
lastrec = rst.Fields("Serial")
If lastrec <> tblrecs Then 'Records in table different from last record Serial number
Beep ' Sound a tone.
MsgBox "Total records in SBCMembers Table is " & tblrecs &Chr(13) & Chr(13) _
& "Last record Number is " & lastrec & Chr(13) & Chr(13) _
& "Please advise xxxxx xxxxx of this error and quote the above numbers", _
vbExclamation, "WARNING - Records Discrepancy!"
Set dbs = Nothing