K
kono316
Hello and thanks for any help that's provided.
I am trying to pass a primary key on one form to another form that will use
it as a foreign key. I want the value passed to be the most recent record
displayed on the initial form. I have created a module with a global
variable that is assigned the primary key value upon the 1st form's save
function. I have debugged and the value is correctly assigned.
Unfortunately when another button on the form is pressed the variable loses
it's value. Everything seems correct and this should be pretty cut and dry
but my coding skills are rusty and I'm not seeing the error.
Module:
Option Compare Database
Public lngNaBusUnitId As Long
1st Form, variable value assigned:
lngNaBusUnitId = CLng(Me.NA_BUS_UNIT_ID.Text)
I am trying to pass a primary key on one form to another form that will use
it as a foreign key. I want the value passed to be the most recent record
displayed on the initial form. I have created a module with a global
variable that is assigned the primary key value upon the 1st form's save
function. I have debugged and the value is correctly assigned.
Unfortunately when another button on the form is pressed the variable loses
it's value. Everything seems correct and this should be pretty cut and dry
but my coding skills are rusty and I'm not seeing the error.
Module:
Option Compare Database
Public lngNaBusUnitId As Long
1st Form, variable value assigned:
lngNaBusUnitId = CLng(Me.NA_BUS_UNIT_ID.Text)