422,027 Members | 1,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,027 IT Pros & Developers. It's quick & easy.

expected array: compile error WHEN I MAKE EXE IT SHOWS ERROR EXPECTED ARRAY IN STR_PV

P: 1
Public Sub Sub_serialNo()
Dim rs_tmp12 As New ADODB.Recordset
Dim STR_PVNO As String
Set rs_tmp12 = Nothing
rs_tmp12.Open "Select prefix from VoucherTypeMst where Name='JOURNAL VOUCHER'", conn, adOpenDynamic, adLockOptimistic
If Not rs_tmp12.EOF Then
STR_PVNO = BRANCHCODE & rs_tmp12(0) & Format(MONTH(Date), "00") & Format(Day(Date), "00")
End If

If rs_tmp12.State = adStateOpen Then rs_tmp12.Close

rs_tmp12.Open "Select right(max(Voucherno),3) from VoucherMst where VoucherType='JOURNAL VOUCHER' and Voucherdate='" & Format(Date, "mm/dd/yyyy") & "' AND Branchcode='" & BRANCHCODE & "' AND LEFT(VOUCHERNO,3)='" & BRANCHCODE & "' and len(voucherno)=12 and autogen>0", conn, adOpenDynamic, adLockOptimistic

If IsNull(rs_tmp12(0)) Then
STR_PVNO = STR_PVNO & Format(1, "000")
Else
STR_PVNO = STR_PVNO & Format(Val(rs_tmp12(0)) + 1, "000")
End If
VNO = STR_PVNO
End Sub
Oct 3 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.