Good Day Everyone,
Just wondering if I can get some help you one of the Access Guru for my Access problem.
I am trying to group by my query based on supplier's name and retrive the last serial number of the backcharge and add 1 into that for the next one.
Record would be sort like below:
Servial # Supplier Name
1 AB
2 AB
3 AB
1 CD
2 CD
1 EF
2 EF
3 EF
4 EF
On the form if Supplier AB is focus in down down box I want to get 4 in next serial number field?
Please advise how to achieve above result.
-------------
Following are some of my thought that I tried and did not work
Query:
SELECT Count(FinalBackchargeLog.FSupToBeChargedNumber) AS MaxOfFSupToBeChargedNumber
FROM FinalBackchargeLog
GROUP BY FinalBackchargeLog.FSupplierToBeCharged
HAVING (((FinalBackchargeLog.FSupplierToBeCharged)=Forms![Add New Backcharge]!txtFSupplierToBeCharged));
On Event:
Dim loc As String
Me.txtSerialNo.SetFocus
loc = DLookup("MaxOfFSupToBeChargedNumber", "BackchargeLogSerialNumber_Q")
Me.txtSerialNo.Value = loc + 1