WaldinTheAnalyst
Member
- Local time
- Tomorrow, 01:41
- Joined
- Sep 6, 2024
- Messages
- 33
Hi I've created a cross-reference (see also or related to) pop up form, which will allow users to display any verses that are linked to a specific verse as cross-references. For example, if Verse A mentions or has a thematic link to verse B, this relationship can be displayed and accessed through the cross-reference form. Users can create new associations between the current and other related verses.
however, my Cross-Reference Popup form does not carry over the verse_id from the Verses form.
I've added a button and code to pass the Verse_id from "Verse form" over to fk3_verse_id in "Cross Reference Form" using OpenArgs.ive also added on load event in "Cross-References Form" to enure that the passed OpenArgs value is correctly assigned to the fk3_Verse_id field.
my button opens the Cross_Reference form but does not carry over the Verse_id please see my code below and assist.
below is my code
however, my Cross-Reference Popup form does not carry over the verse_id from the Verses form.
I've added a button and code to pass the Verse_id from "Verse form" over to fk3_verse_id in "Cross Reference Form" using OpenArgs.ive also added on load event in "Cross-References Form" to enure that the passed OpenArgs value is correctly assigned to the fk3_Verse_id field.
my button opens the Cross_Reference form but does not carry over the Verse_id please see my code below and assist.
below is my code
Code:
'Code for the button that opens the cross-reference form
Private Sub btnOpenCrossReferences_Click()
On Error GoTo ErrHandler
' Open the CrossReferences form and pass the Verse_ID as OpenArgs
DoCmd.OpenForm "frmCrossReferences", , , , , , Me.verse_id
Exit Sub
ErrHandler:
MsgBox "Error: " & Err.Description
End Sub
' Code for the Form_Load event of the cross-reference form
Private Sub Form_Load()
On Error GoTo ErrHandler
' Check if OpenArgs has been passed to the form
If Not IsNull(Me.OpenArgs) Then
' Set the fk3_verse_id field to the passed value
Me!fk3_verse_id = Me.OpenArgs
' Apply a filter to display only relevant cross-references
Me.Filter = "fk3_verse_id = " & Me.OpenArgs
Me.FilterOn = True
End If
Exit Sub
ErrHandler:
MsgBox "Error: " & Err.Description
End Sub
Attachments
Last edited by a moderator: