Please forgive me for my Noobieness - I am trying to create a control button that will open a form based on particular field on my main form. I tried to use the button wizard but that didn't work so I copied the event procedure code from another control button and edited it to point to the correct form to open when clicked. Here is the code:
__________________________________________
Private Sub Fred_Click()
On Error GoTo Err_Fred_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Basler BE125 SETTINGS"
stLinkCriteria = "RELAY![RELAY #]=" & Me![RELAY #]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Fred_Click:
Exit Sub
Err_Fred_Click:
MsgBox Err.Description
Resume Exit_Fred_Click
End Sub
___________________________________________
Fred was the unique identifier I chose so it would stand out better when I was looking at all the code. The way the control button is suppossed to work, you select a particular Relay # on the Relay Tab Sheet and then click on the BE-125 button to open to a single filtered record on the Basler BE125 Setting form. Instead, I get a pop up box asking for the Relay# and once I enter it, I still get all 84 items in my table. Any ideas? Thanks!!!