Real Wally
Registered User.
- Local time
- Today, 22:59
- Joined
- Jan 28, 2003
- Messages
- 107
Hi,
I've struggling wity this issue for some time now.
What I have is a form with key field SearchID (autonumber) and a button that opens a secondary form with notes attached to the record on the first form. The 2 forms are linked by the SearchID number. This works without a problem when the frmNotes_short actually has a value in the SearchID field. However, a problem occurs when I open a secondary field for the first time, the SearchID field has the default value 0. I know it's not a huge effort to manually add the ID# but it would be so much nicer if that number gets copied automatically from the first form (frmSearches). I've gone through many postings that address similar issues but cannot get it to work. Here's the code I curently use:
Button on the frmSearch:
Private Sub shortnotes_Click()
DoCmd.OpenForm "frmSearches",,,,,,Me!
SearchID
End Sub
On open event for secondary form:
If Not IsNull(Me.OpenArgs) Then
SearchID.SetFocus
SearchID= Me.OpenArgs
Call SearchID_AfterUpdate
End If
Can anyone tell me what it is I'm doing wrong please?
Wally
I've struggling wity this issue for some time now.
What I have is a form with key field SearchID (autonumber) and a button that opens a secondary form with notes attached to the record on the first form. The 2 forms are linked by the SearchID number. This works without a problem when the frmNotes_short actually has a value in the SearchID field. However, a problem occurs when I open a secondary field for the first time, the SearchID field has the default value 0. I know it's not a huge effort to manually add the ID# but it would be so much nicer if that number gets copied automatically from the first form (frmSearches). I've gone through many postings that address similar issues but cannot get it to work. Here's the code I curently use:
Button on the frmSearch:
Private Sub shortnotes_Click()
DoCmd.OpenForm "frmSearches",,,,,,Me!
SearchID
End Sub
On open event for secondary form:
If Not IsNull(Me.OpenArgs) Then
SearchID.SetFocus
SearchID= Me.OpenArgs
Call SearchID_AfterUpdate
End If
Can anyone tell me what it is I'm doing wrong please?
Wally