G
Gen
I have two tables: Table 1 stores the primary key, Protocol#, along with
details about the protocol. Table 2 stores additional information that will
apply to SOME of hte protocols. It has no primary key, but is linked to table
1 through Protocol#.
Problem: Form 1 is where I enter details into Table 1. I'd like to enter
information into Table 2 using a separate form (not a subform), Form 2, which
I can access from Form 1 using a button. I set the VBA code to open Form 2 as
follows:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRM_2"
stLinkCriteria = "[Protocol#]=" & "'" & Me![Protocol#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works when there is already information entered about a protocol# in
Table 2, but when I want to add new information using Form 2, when form 2
opens the protocol number is blank - it should be identical to the protocol#
currently displayed on Form 1! Incidentally, when I put Form 2 into Form 1 as
a subform, it works perfectly, but I'd really like them to be separate.
Can anyone help? Thanks very much.
details about the protocol. Table 2 stores additional information that will
apply to SOME of hte protocols. It has no primary key, but is linked to table
1 through Protocol#.
Problem: Form 1 is where I enter details into Table 1. I'd like to enter
information into Table 2 using a separate form (not a subform), Form 2, which
I can access from Form 1 using a button. I set the VBA code to open Form 2 as
follows:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRM_2"
stLinkCriteria = "[Protocol#]=" & "'" & Me![Protocol#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works when there is already information entered about a protocol# in
Table 2, but when I want to add new information using Form 2, when form 2
opens the protocol number is blank - it should be identical to the protocol#
currently displayed on Form 1! Incidentally, when I put Form 2 into Form 1 as
a subform, it works perfectly, but I'd really like them to be separate.
Can anyone help? Thanks very much.