default job number - highest last input plus one

B

babs

I have the below code attached to the after update event of the clientid. I
would like to keep it the way it is but add code to make the DEFAULT job# be
the highest(last one) for that selected clientid. As of right now they can
select one from the list - GOOD but to input a NEW job he has to look down
and see the highest number job on the list and add 1 - sometimes there are
mistakes and think you should be able to set the default to do this.

Please help me add code below for the default job# as explained above.

Private Sub cboClientId_AfterUpdate()
Dim sSql As String
Dim nsql As String

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
sSql = "SELECT DISTINCT Job, Taxex, Jobdesc, ClientId " & "FROM tblQUOTEJOE
" & "WHERE ClientId = """ & Me.cboClientId & """ " & "ORDER BY Job"
Me.cbojob.RowSource = sSql

'This function sets the RowSource of ClientId, based on the value selected
in ClientId
nsql = "SELECT DISTINCT Taxex,job, ClientId " & "FROM tbltaxexempt " &
"WHERE ClientId = """ & Me.cboClientId & """ " & "ORDER BY job"
Me.cbotaxex.RowSource = nsql

End Sub


thanks,
Barb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top