P
Paul B.
I have the following code which pull a table record number which I need to
insert into another table along with other values from the form. When I click
save, I get a pop-up asking for the value of mRecordID. How do I correct this
so it uses the variable defined?
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim mRecordID As Long
mRecordID = DMax("RecordNumber", "tblEpistry")
MsgBox ("Record #" & mRecordID)
If Unit1 = True Then
DoCmd.RunSQL "INSERT INTO tblUnits(EpistryTableRecordNumber, UnitNumber,_
EventNumber, Form2, CAMT, AEDDL) VALUES(mRecordID,
[UnitNumber],_[EventNumber], [Form2], [CAMT], [AEDDL])"
End If
Thanks in advance.
insert into another table along with other values from the form. When I click
save, I get a pop-up asking for the value of mRecordID. How do I correct this
so it uses the variable defined?
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim mRecordID As Long
mRecordID = DMax("RecordNumber", "tblEpistry")
MsgBox ("Record #" & mRecordID)
If Unit1 = True Then
DoCmd.RunSQL "INSERT INTO tblUnits(EpistryTableRecordNumber, UnitNumber,_
EventNumber, Form2, CAMT, AEDDL) VALUES(mRecordID,
[UnitNumber],_[EventNumber], [Form2], [CAMT], [AEDDL])"
End If
Thanks in advance.