E
ElizCat
I have an unbound combo box on a popup form that I want to use to select a
record ID to pass to the main form. I've got most things working, but the
unbound combo does not pass the selected record ID to the main form. The
main form always displays the first record in the list, regardless of what
record ID was selected in the popup. The same popup is used with multiple
forms, and I'm using a Select Case command to determine which form to return
the record ID to, depending on which form called it (thank you Mark Sam, for
your code!)
Can anyone figure out what I've got going on?
Thanks in advance, ElizCat
Here's an example of the code I'm using:
on the popup form OK/close button:
********test code***************
Private Sub OKbutton_click()
Select Case OpenArgs
Case 1 'assign Sample ID to the dataForm
Set frm = Forms!dataForm
If fIsLoaded("dataForm") Then
frm![SampleID] = [SampleID]
Else: DoCmd.Close
End If
End Select
*************************************
on the main form, from the button that calls the popup
**************test code*******************
Dim stDocName As String
stDocName = "SampleIDFinder"
DoCmd.OpenForm stDocName, , , , , acDialog, 1
'don't forget to update the style number
Me.SN = Null
Me.SN.Requery
Me.SN = Me.SN.ItemData(0)
record ID to pass to the main form. I've got most things working, but the
unbound combo does not pass the selected record ID to the main form. The
main form always displays the first record in the list, regardless of what
record ID was selected in the popup. The same popup is used with multiple
forms, and I'm using a Select Case command to determine which form to return
the record ID to, depending on which form called it (thank you Mark Sam, for
your code!)
Can anyone figure out what I've got going on?
Thanks in advance, ElizCat
Here's an example of the code I'm using:
on the popup form OK/close button:
********test code***************
Private Sub OKbutton_click()
Select Case OpenArgs
Case 1 'assign Sample ID to the dataForm
Set frm = Forms!dataForm
If fIsLoaded("dataForm") Then
frm![SampleID] = [SampleID]
Else: DoCmd.Close
End If
End Select
*************************************
on the main form, from the button that calls the popup
**************test code*******************
Dim stDocName As String
stDocName = "SampleIDFinder"
DoCmd.OpenForm stDocName, , , , , acDialog, 1
'don't forget to update the style number
Me.SN = Null
Me.SN.Requery
Me.SN = Me.SN.ItemData(0)