I am currently working on a way to automatically generate our clients account number. I have the process pretty much working the only issue i have is the global variable does not update. the form reads the variable and does the mathematical calculations necessary but even though i set the new number equal to the old the variable remains the same number each time i restart the form. I will include the coding for both my form and module below.
If anyone has an idea i would greatly appreciate the assitance it has been a very long time since i have coded in access.
Module Code:
Form Code:
Thank you again for your help in advance.
If anyone has an idea i would greatly appreciate the assitance it has been a very long time since i have coded in access.
Module Code:
Code:
Option Compare Database
Option Explicit
Global GenAct As Integer
Public Sub Init_Globals()
GenAct = 43
End Sub
Code:
Private Sub Form_Load()
Call Init_Globals
Dim act As Integer
Dim actbeg As Double
actbeg = 4230000
act = GenAct + 1
GenAct = act
starttb.Value = date
statustb.Value = "Pending"
accounttb.Value = actbeg & act
End Sub