I am trying to run an update from a form to auto-increment a number.
Private Sub CatItemNum_Click()
If Me.ItemCat = "3" Then
Me.CatNumber = DMax("CatNumber", "CatItemNum") + 1
ElseIf Me.ItemCat = "4" Then
Me.CatNumber = DMax("CatNumber", "CatItemNum") + 1
Else
Me.CatNumber = Null
End If
The form has a combo box for the ItemCat and I'd like to have the dmax use that value to populate the "Catnumber" field that is used to lookup the
increment number from the CatItemNum table.
CatItemNum - Table used to store the autonum
| 3 | 4 | 5 |
|100|200|300|
So if ItemCat =3 the 100 is used if it's 4 then 200 is used.
Is this possible.
Also after how would I increment the stored value in the CatItemNum table.
Thanks in advance,
End Sub
Private Sub CatItemNum_Click()
If Me.ItemCat = "3" Then
Me.CatNumber = DMax("CatNumber", "CatItemNum") + 1
ElseIf Me.ItemCat = "4" Then
Me.CatNumber = DMax("CatNumber", "CatItemNum") + 1
Else
Me.CatNumber = Null
End If
The form has a combo box for the ItemCat and I'd like to have the dmax use that value to populate the "Catnumber" field that is used to lookup the
increment number from the CatItemNum table.
CatItemNum - Table used to store the autonum
| 3 | 4 | 5 |
|100|200|300|
So if ItemCat =3 the 100 is used if it's 4 then 200 is used.
Is this possible.
Also after how would I increment the stored value in the CatItemNum table.
Thanks in advance,
End Sub