Ive got a Product table that has a productID.
This is incremented insdie the access table itself with auto increment.
Now ive got a AddProduct Form which has the necessary txt boxes for the user to input the information. What im trying to do is show the ProductID on the Add form.
The product ID is located in the tblProduct and i want to display the next value in it.
This is my code atm
Ive tried this and its not working.
Any help??
This is incremented insdie the access table itself with auto increment.
Now ive got a AddProduct Form which has the necessary txt boxes for the user to input the information. What im trying to do is show the ProductID on the Add form.
The product ID is located in the tblProduct and i want to display the next value in it.
This is my code atm
Code:
Dim prodno As Recordset
Private Sub Form_load()
Set dbs = CurrentDb
Dim mysql As String
mysql = "SELECT MAX(ProductID) FROM tblProduct;"
Set prodno = dbs.OpenRecordset("tblProduct", dbOpenDynaset)
txtProdID.Value = prodno![ProductID]
Any help??
Comment