I'm running some code to create a new record in a table based on values in another table/form. When the user clicks the button to open the form, I'm running the below code to create the new record. The new record is being created, however, the values are not populating into the two fields I've designated.
I need the same number to populate in two fields in table 1002 based on fields in the main table 1001, which is referenced in the Me.
You're probably wondering why I put the same number in two different fields - it's because the recordnum is an old tracking number that I need to continue to use.
Thanks for any help!
Carie
I need the same number to populate in two fields in table 1002 based on fields in the main table 1001, which is referenced in the Me.
Code:
Dim recordnum As Long
If IsNull(Me.recordnum) = True Then
Me.fld_Created_User = Me.txt_Current_User
recordnum = Me.fld_ACC_Master_Record_No
DoCmd.RunSQL ("INSERT INTO [1002_Bankruptcy_SchG_tbl] (fld_ACC_Master_Record_No, recordnum) VALUES (recordnum, recordnum);")
End If
You're probably wondering why I put the same number in two different fields - it's because the recordnum is an old tracking number that I need to continue to use.
Thanks for any help!
Carie