bobbobruns12
Technical User
Hey I have four tables that I am looking to collect into one report. I created a query and have combined all of them but now have to write the code in order to call up specific records based on id numbers. My original code to do this before with just 2 tables is this:
Private Sub TransDatacmd_Click()
On Error GoTo Err_Transdatacmd_Click
Dim stDocName As String
Dim stLinkCriteria As String
TransDatachk.Value = True
stDocName = "TransDataEntryfrm"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'saves record
strAddFilter = " ID= " & Chr(34) & Me.CompleteIDtxt.Value & Chr(34)
DoCmd.OpenForm stDocName, , , strAddFilter, , , Me.CompleteIDtxt
Exit_TransDatacmd_Click:
Exit Sub
Err_Transdatacmd_Click:
MsgBox Err.Description
Resume Exit_TransDatacmd_Click
End Sub
I have been generally putting this code (or altered versions) into the command buttons and would like to write code to call up all the different data from all the tables based on the ID number. However I have different IDs connecting 2 of the forms. This seems complicated, to me anyway, and if anyone has any ideas on how to write code to accomplish this I would greatly appreciate it. Thanks
Bob
Private Sub TransDatacmd_Click()
On Error GoTo Err_Transdatacmd_Click
Dim stDocName As String
Dim stLinkCriteria As String
TransDatachk.Value = True
stDocName = "TransDataEntryfrm"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'saves record
strAddFilter = " ID= " & Chr(34) & Me.CompleteIDtxt.Value & Chr(34)
DoCmd.OpenForm stDocName, , , strAddFilter, , , Me.CompleteIDtxt
Exit_TransDatacmd_Click:
Exit Sub
Err_Transdatacmd_Click:
MsgBox Err.Description
Resume Exit_TransDatacmd_Click
End Sub
I have been generally putting this code (or altered versions) into the command buttons and would like to write code to call up all the different data from all the tables based on the ID number. However I have different IDs connecting 2 of the forms. This seems complicated, to me anyway, and if anyone has any ideas on how to write code to accomplish this I would greatly appreciate it. Thanks
Bob