"Nick Mirro" <(E-Mail Removed)> wrote:
>If option group "FormToOpen" is 1, the correct form opens, but the subform
>record desired is not displayed.
>
>If option group "FormToOpen" isn't 1, then it hangs on the ***OpenForm
>command.
>I created a command button to duplicate this "isn't 1" action and got this
>error:
>
> "Syntax error in string in query expression '[VisitID]=""
>Private Sub lstRecentPatients_AfterUpdate()
>
> If FormToOpen = 1 Then
>
> --- snip ---
> End If
>
> If Not FormToOpen = 1 Then
>
> Dim stDocName As String
> Dim stLinkCriteria As String
>
> stDocName = "frmReceivePayments"
>
> stLinkCriteria = "VisitID=" & "'" & Me!lstRecentPatients.Column(10)
>& "'"
> ***DoCmd.OpenForm stDocName, , , stLinkCriteria
Nick,
as I see further above, the VisitID is probably numerical, so leave
out the quotes:
stLinkCriteria = "VisitID=" & Me!lstRecentPatients.Column(10)
Best regards
Emilia
Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de