Hi, Hope some body can help out:
I have a form call "Template" (frm_Template), In this form, I have a field called ContractID. I have a command button in this form to open frm_Contract. Frm_Contract has a field called as ContractID too. Now the command button will open frm_Contract in the first record. I would like make it open the frm_Contract based on the ContractID in frm_Template. Ex: If ContractID in frm_Template is A122, the command button in frm+Template will open frm_Contract in record that ContractID is A122. Currently, the open form command code is as follows. How do I adjust to do the above?
Private Sub Templates_Click()
On Error GoTo Err_Templates_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Template"
DoCmd.openForm stDocName, , , stLinkCriteria
Exit_Templates_Click:
Exit Sub
Err_Templates_Click:
MsgBox Err.Description
Resume Exit_Templates_Click
End Sub
Thanks ahead.
NP02
I have a form call "Template" (frm_Template), In this form, I have a field called ContractID. I have a command button in this form to open frm_Contract. Frm_Contract has a field called as ContractID too. Now the command button will open frm_Contract in the first record. I would like make it open the frm_Contract based on the ContractID in frm_Template. Ex: If ContractID in frm_Template is A122, the command button in frm+Template will open frm_Contract in record that ContractID is A122. Currently, the open form command code is as follows. How do I adjust to do the above?
Private Sub Templates_Click()
On Error GoTo Err_Templates_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Template"
DoCmd.openForm stDocName, , , stLinkCriteria
Exit_Templates_Click:
Exit Sub
Err_Templates_Click:
MsgBox Err.Description
Resume Exit_Templates_Click
End Sub
Thanks ahead.
NP02