本文介绍了如何生成自动发票号码......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用这段代码但是这里有些问题,我不明白是什么问题 问题是:这是一个很好的空白数据库(意思是启动E000001)到E000009,之后就显示了数字E000011之后没有激怒数字。请帮助我。 我尝试过: Sub generate_inv() Dim id_tmp As String Query =通过InoviceNo desc从Invoice order中选择前1名InoviceNo cmd =新OleDbCommand(query,cn) dr = cmd.ExecuteReader 如果dr.HasRows = False那么 dr.Close() id_tmp =E000001否则 dr.Read() id_tmp =格式(中(dr(InoviceNo),2,6)+ 1,E00000#)结束如果 dr.Close() txtInvoice.Text = id_tmp End Sub 解决方案 I use this code but some problem here, I con't understand what is the problemProblem is : It is fine work blank database(means starting E000001) to E000009, after that showing the number E000011 after that no incensed the number. Please Help me.What I have tried:Sub generate_inv()Dim id_tmp As StringQuery = "select top 1 InoviceNo from Invoice order by InoviceNo desc"cmd = New OleDbCommand(query, cn)dr = cmd.ExecuteReaderIf dr.HasRows = False Thendr.Close()id_tmp = "E000001"Elsedr.Read()id_tmp = Format(Mid(dr("InoviceNo"), 2, 6) + 1,"E00000#")End Ifdr.Close()txtInvoice.Text = id_tmpEnd Sub 解决方案 这篇关于如何生成自动发票号码......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 19:47