This is in Access 2003.
In my form (continuous, if that matters), when the user clicks on the [UIC] field, I want to open a subform and display the record containing the same UIC (unit identification code).
This is my current code on the click event:
And the query that the second form is based on:
Now - when I click on the UIC field, I'm prompted for a parameter. But instead of asking me for "Me!UIC" like I'd expect....it already lists the text that is stored in the UIC field.
Ie - if the text in the UIC field is "XXX", it lists "XXX" as the requested parameter instead of "Me!UIC"....and then when I enter "XXX" as the criteria that I want, it opens the form correctly.
So any ideas on why it's prompting me for the parameter instead of just opening the form with the correct criteria?
In my form (continuous, if that matters), when the user clicks on the [UIC] field, I want to open a subform and display the record containing the same UIC (unit identification code).
This is my current code on the click event:
Code:
Private Sub UIC_Click()
On Error GoTo Err_UIC_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "sf_STRENGTH"
stLinkCriteria = "[UIC]=" & Me![UIC]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UIC_Click:
Exit Sub
Err_UIC_Click:
MsgBox Err.Description
Resume Exit_UIC_Click
End Sub
And the query that the second form is based on:
Code:
SELECT q_AUTH.UIC, q_AUTH.SumOfAUTH AS AUTH, q_ASSIGNED.CountOfSSN AS ASSIGNED, [CountOfSSN]/[SumOfAUTH] AS STRENGTH
FROM q_AUTH LEFT JOIN q_ASSIGNED ON q_AUTH.UIC=q_ASSIGNED.UIC;
Now - when I click on the UIC field, I'm prompted for a parameter. But instead of asking me for "Me!UIC" like I'd expect....it already lists the text that is stored in the UIC field.
Ie - if the text in the UIC field is "XXX", it lists "XXX" as the requested parameter instead of "Me!UIC"....and then when I enter "XXX" as the criteria that I want, it opens the form correctly.
So any ideas on why it's prompting me for the parameter instead of just opening the form with the correct criteria?
Last edited: