I did it many times but now I forgot it and cannot open a form for a specific
value.
There was a method that create the following code automatically. We can
match the values and even determine the picture or text on the toggle button
with that method . Please help.
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form"
stLinkCriteria = "[PARTNO]=" & "'" & Me![Combo5] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command19_Click:
Exit Sub
Err_Command19_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command19_Click
End Sub
Ofer - 30 Sep 2005 08:51 GMT
If the Part No field is number you should try this
stLinkCriteria = "[PARTNO]=" & Me![Combo5]
DoCmd.OpenForm stDocName, , , stLinkCriteria
===================================
If the Part No field is text you should try this
stLinkCriteria = "[PARTNO]= '" & Me![Combo5] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
===================================
If the Part No, is not the first column in the combo, then you should
specify the column number
stLinkCriteria = "[PARTNO]= '" & Me![Combo5].column(1) & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
'the column number start with 0

Signature
I hope that helped
Good luck
> I did it many times but now I forgot it and cannot open a form for a specific
> value.
[quoted text clipped - 21 lines]
>
> End Sub
Ofer - 30 Sep 2005 08:59 GMT
One more thing, if the form name is "form", it a word that bean used by
access, you better change the name, it can cause to some problems

Signature
I hope that helped
Good luck
> I did it many times but now I forgot it and cannot open a form for a specific
> value.
[quoted text clipped - 21 lines]
>
> End Sub
AhmtDY - 30 Sep 2005 10:23 GMT
Thank you but threre is a tool for dummies(I used to know and use many times,
but I forgot). Not a code. It creates that code. I will go to mad.
> One more thing, if the form name is "form", it a word that bean used by
> access, you better change the name, it can cause to some problems
[quoted text clipped - 24 lines]
> >
> > End Sub