hello guys need some help, i need to generate id the problem is i cannot get the last row from database
logical view
DATABASE
tbloutlet
PCSO20121
PCSO20122
PCSO20123
NOW
need to get
"PCSO20123"
select the last character '3' using mid
after selecting '3' convert to int and add to 1 VAl=3+1
"PCSO2012" & VAL
Main problem cannot select last row from the database "PCSO20123"
rs.Open "select max(OUTLET_ID) as IDS from tblOutlet", conn, adOpenStatic, adLockReadOnly
'ids = rs.Fields("IDS")
If rs.BOF And rs.EOF Then
nonIds = "PCSO" & strYear & "1"
txtOutletID.Text = ids
Else
genid = Mid$(rs.Fields("IDS"), 8, 1)
inty = CInt(genid) + 1
idhand = "PCSO" & strYear & CStr(inty)
End If
txtOutletID.Text = genid
End Sub